Corrade::Utility::Directory namespace

Filesystem utilities.

Typedefs

using MapDeleter = Path::MapDeleter deprecated in Git master
Memory-mapped file deleter.
using Flag = Path::ListFlag deprecated in Git master
Listing flag.
using Flags = Path::ListFlags deprecated in Git master
Listing flags.

Functions

auto fromNativeSeparators(const std::string& path) -> std::string deprecated in Git master
Convert path from native separators.
auto toNativeSeparators(const std::string& path) -> std::string deprecated in Git master
Convert path to native separators.
auto path(const std::string& filename) -> std::string deprecated in Git master
Extract path from filename.
auto filename(const std::string& filename) -> std::string deprecated in Git master
Extract filename (without path) from filename.
auto splitExtension(const std::string& path) -> std::pair<std::string, std::string> deprecated in Git master
Split basename and extension.
auto join(const std::string& path, const std::string& filename) -> std::string deprecated in Git master
Join path and filename.
auto join(std::initializer_list<std::string> paths) -> std::string deprecated in Git master
Join paths.
auto list(const std::string& path, Flags flags = {}) -> std::vector<std::string> deprecated in Git master
List directory contents.
auto mkpath(const std::string& path) -> bool deprecated in Git master
Create a path.
auto rm(const std::string& path) -> bool deprecated in Git master
Remove a file or a directory.
auto move(const std::string& from, const std::string& to) -> bool deprecated in Git master
Move given file or directory.
auto isSandboxed() -> bool deprecated in Git master
Whether the application runs in a sandboxed environment.
auto current() -> std::string deprecated in Git master
Current directory.
auto libraryLocation(const void* address) -> std::string deprecated in Git master
Shared library location containing given address.
template<class R, class ... Args>
auto libraryLocation(R(*)(Args...) address) -> std::string deprecated in Git master
auto executableLocation() -> std::string deprecated in Git master
Executable location.
auto home() -> std::string deprecated in Git master
Current user's home directory.
auto configurationDir(const std::string& name) -> std::string deprecated in Git master
Application configuration dir.
auto tmp() -> std::string deprecated in Git master
Temporary dir.
auto exists(const std::string& filename) -> bool deprecated in Git master
Check if the file or directory exists.
auto isDirectory(const std::string& path) -> bool deprecated in Git master
Check if given path is a directory.
auto fileExists(const std::string& filename) -> bool deprecated in 2019.10
Check if the file or directory exists.
auto fileSize(const std::string& filename) -> Containers::Optional<std::size_t> deprecated in Git master
File size.
auto read(const std::string& filename) -> Containers::Array<char> deprecated in Git master
Read a file into an array.
auto readString(const std::string& filename) -> std::string deprecated in Git master
Read a file into a string.
auto write(const std::string& filename, Containers::ArrayView<const void> data) -> bool deprecated in Git master
Write an array into a file.
auto writeString(const std::string& filename, const std::string& data) -> bool deprecated in Git master
Write a string into a file.
auto append(const std::string& filename, Containers::ArrayView<const void> data) -> bool deprecated in Git master
Append an array to a file.
auto appendString(const std::string& filename, const std::string& data) -> bool deprecated in Git master
Append a string to a file.
auto copy(const std::string& from, const std::string& to) -> bool deprecated in Git master
Copy a file.
auto map(const std::string& filename) -> Containers::Array<char, MapDeleter> deprecated in Git master
Map a file for reading and writing.
auto mapRead(const std::string& filename) -> Containers::Array<const char, MapDeleter> deprecated in Git master
Map a file for reading.
auto mapWrite(const std::string& filename, std::size_t size) -> Containers::Array<char, MapDeleter> deprecated in Git master
Map a file for writing.
auto map(const std::string& filename, std::size_t size) -> Containers::Array<char, MapDeleter> deprecated in 2020.06
Map a file for writing.

Typedef documentation

typedef Path::MapDeleter Corrade::Utility::Directory::MapDeleter

Memory-mapped file deleter.

typedef Path::ListFlag Corrade::Utility::Directory::Flag

Listing flag.

typedef Path::ListFlags Corrade::Utility::Directory::Flags

Listing flags.

Function documentation

std::string Corrade::Utility::Directory::fromNativeSeparators(const std::string& path)

Convert path from native separators.

std::string Corrade::Utility::Directory::toNativeSeparators(const std::string& path)

Convert path to native separators.

std::string Corrade::Utility::Directory::path(const std::string& filename)

Extract path from filename.

std::string Corrade::Utility::Directory::filename(const std::string& filename)

Extract filename (without path) from filename.

std::pair<std::string, std::string> Corrade::Utility::Directory::splitExtension(const std::string& path)

Split basename and extension.

std::string Corrade::Utility::Directory::join(const std::string& path, const std::string& filename)

Join path and filename.

std::vector<std::string> Corrade::Utility::Directory::list(const std::string& path, Flags flags = {})

List directory contents.

bool Corrade::Utility::Directory::mkpath(const std::string& path)

Create a path.

bool Corrade::Utility::Directory::rm(const std::string& path)

Remove a file or a directory.

bool Corrade::Utility::Directory::move(const std::string& from, const std::string& to)

Move given file or directory.

bool Corrade::Utility::Directory::isSandboxed()

Whether the application runs in a sandboxed environment.

std::string Corrade::Utility::Directory::current()

Current directory.

std::string Corrade::Utility::Directory::libraryLocation(const void* address)

Shared library location containing given address.

template<class R, class ... Args>
std::string Corrade::Utility::Directory::libraryLocation(R(*)(Args...) address)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

std::string Corrade::Utility::Directory::executableLocation()

Executable location.

std::string Corrade::Utility::Directory::home()

Current user's home directory.

std::string Corrade::Utility::Directory::configurationDir(const std::string& name)

Application configuration dir.

std::string Corrade::Utility::Directory::tmp()

Temporary dir.

bool Corrade::Utility::Directory::exists(const std::string& filename)

Check if the file or directory exists.

bool Corrade::Utility::Directory::isDirectory(const std::string& path)

Check if given path is a directory.

bool Corrade::Utility::Directory::fileExists(const std::string& filename)

Check if the file or directory exists.

Containers::Optional<std::size_t> Corrade::Utility::Directory::fileSize(const std::string& filename)

File size.

Containers::Array<char> Corrade::Utility::Directory::read(const std::string& filename)

Read a file into an array.

std::string Corrade::Utility::Directory::readString(const std::string& filename)

Read a file into a string.

bool Corrade::Utility::Directory::write(const std::string& filename, Containers::ArrayView<const void> data)

Write an array into a file.

bool Corrade::Utility::Directory::writeString(const std::string& filename, const std::string& data)

Write a string into a file.

bool Corrade::Utility::Directory::append(const std::string& filename, Containers::ArrayView<const void> data)

Append an array to a file.

bool Corrade::Utility::Directory::appendString(const std::string& filename, const std::string& data)

Append a string to a file.

bool Corrade::Utility::Directory::copy(const std::string& from, const std::string& to)

Copy a file.

Containers::Array<char, MapDeleter> Corrade::Utility::Directory::map(const std::string& filename)

Map a file for reading and writing.

Containers::Array<const char, MapDeleter> Corrade::Utility::Directory::mapRead(const std::string& filename)

Map a file for reading.

Containers::Array<char, MapDeleter> Corrade::Utility::Directory::mapWrite(const std::string& filename, std::size_t size)

Map a file for writing.

Containers::Array<char, MapDeleter> Corrade::Utility::Directory::map(const std::string& filename, std::size_t size)

Map a file for writing.