25 #ifndef COMMON_FILEPATH_H 26 #define COMMON_FILEPATH_H 180 bool caseInsensitive =
false);
248 #endif // COMMON_FILEPATH_H static UString getUserDataDirectory()
Return the OS-specific path of the user data directory.
static UString getHumanReadableSize(size_t size)
Format this file size into a human readable string.
A class holding an UTF-8 string.
static UString absolutize(const UString &p)
Return the absolute path.
static UString getExtension(const UString &p)
Return a file name's extension.
static bool getSubDirectories(const UString &directory, std::list< UString > &subDirectories)
Collect all direct subdirectories of a directory in a list.
static bool isDirectory(const UString &p)
Does specified path exist and is it a directory?
static UString getUserDataFile(UString file)
Return a path suitable for writing into.
static bool isRegularFile(const UString &p)
Does specified path exist and is it a regular file?
static UString escapeStringLiteral(const UString &str)
Escape a string literal for use in a regexp.
Utility class for manipulating file paths.
static UString canonicalize(const UString &p, bool resolveSymLinks=true)
Return the canonical, absolutized and normalized path.
Low-level type definitions to handle fixed width types portably.
static UString getDirectory(const UString &p)
Return a path's directory.
static UString getConfigDirectory()
Return the OS-specific path of the config directory.
static UString getStem(const UString &p)
Return a file name's stem.
static bool createDirectories(const UString &path)
Create all directories in this path.
static bool isAbsolute(const UString &p)
Is the given string an absolute path?
static UString relativize(const UString &basePath, const UString &path)
Return the path relative to the base path.
static size_t getFileSize(const UString &p)
Return a file's size.
static UString normalize(const UString &p, bool resolveSymLinks=true)
Normalize a path.
static const size_t kFileInvalid
static UString getHomeDirectory()
Return the OS-specific path of the user's home directory.
static UString getFile(const UString &p)
Return a file name without its path.
static UString changeExtension(const UString &p, const UString &ext="")
Change a file name's extension.
static UString findSubDirectory(const UString &directory, const UString &subDirectory, bool caseInsensitive=false)
Find a directory's subdirectory.