An essential interface for manipulation with files and directories. Wraps file managing system calls.
More...
|
|
bool | FileExists (const char *filename) |
| | Checks if the specified file exist.
|
| |
|
bool | FileExists (const std::string &filename) |
| | Checks if the specified file exist.
|
| |
|
bool | FileCopy (const std::string &src, const std::string &dest) |
| | Makes a copy of a source file to a destination file. Destination directory must exist.
|
| |
|
bool | FileRename (const std::string &src_file, const std::string &new_name) |
| | Changes name of a source file to a new name.
|
| |
|
bool | FileRemove (const std::string &file) |
| | Deletes a specified file from the system. Deleted file will not appear in recycle bin.
|
| |
|
bool | DirectoryExists (const std::string &dir_path) |
| | Checks whether a specified directory exists. May contain the last slash but is not required.
|
| |
| bool | CreateDir (const std::string &dir_path) |
| | Creates a specified directory. More...
|
| |
| bool | CreateDirHierarchy (const std::string &dir_path) |
| | Creates a specified directory hierarchy. More...
|
| |
|
bool | RemoveDir (const std::string &dir_path, bool recursive=true) |
| | Removes input directory if it is empty or if recursive is set to true.
|
| |
|
std::string | GetExtension (const std::string &filename) |
| | Returns string representing file extension, in lower case with no dot.
|
| |
|
bool | HasExtenstion (const std::string &filename, const std::string &extenstion) |
| | Checks whether the file has a specific extension. An extension parameter is case sensitive and can be specified with or without a dot.
|
| |
|
bool | IsFileType (const std::string &filename, const file_types::Type type) |
| | Checks whether the file is of a specified type.
|
| |
|
bool | IsFileType (const std::string &filename, const std::vector< file_types::Type > &types) |
| | Checks whether the file is any of the specified types.
|
| |
|
std::string | FileToString (const std::string &file_name) |
| | Loads contents of a text-based file and stores it in a string.
|
| |
|
void | StringToFile (const std::string &file_name, const std::string &str) |
| | Exports the string to a text file.
|
| |
|
template<typename T > |
| std::vector< T > | FileToVector (const std::string &file_name) |
| | Loads contents of a text-based file and stores it in a vector. The file must contain only elements of templated type.
|
| |
|
std::vector< FileDirContent > | ListDirectoryContents (std::string direcory_path, const bool recursive=false) |
| | Returns list of all contents in a specified directory.
|
| |
|
std::vector< std::string > | ListDirectoryFileNames (const std::string &direcory_path, const std::string &extension="") |
| | Returns list of all file contents in a specified directory (ignores directories). Providing extension parameter returns only files with specified extension.
|
| |
|
std::vector< std::string > | ListDirectoryFileNames (const std::string &direcory_path, const file_types::Type file_type) |
| | Returns a list of all file contents in a specified directory (ignores directories) with extension of the specified file type.
|
| |
|
std::vector< std::string > | ListDirectoryFileNames (const std::string &direcory_path, const std::vector< file_types::Type > &file_types) |
| | Returns a list of all file contents in a specified directory (ignores directories) with any of the extensions of the specified file types.
|
| |
|
bool | DirectoryContainsAny (const std::string &direcory_path, const file_types::Type file_type) |
| | Checks specified directory if it contains file(s) of specified type.
|
| |
|
bool | DirectoryContainsAny (const std::string &direcory_path, const std::vector< file_types::Type > &file_types) |
| | Checks specified directory if it contains file(s) of any of the specified types.
|
| |
|
std::string | GetDirectoryPathOfFile (const std::string &file_name_with_path) |
| | Takes specified file path and strips everything after the last directory separator (including the separator).
|
| |
|
std::string | GetFileName (const std::string &file_name_with_path, bool strip_extension=false) |
| | Strips everything before the last directory separator, including the separator. If parameter strip_extension is true, strips also extension from resulting file name.
|
| |
|
std::string | GetAbsolutePath (const std::string &local_path) |
| | Retrieves full system path to a specified local file or directory. Specified local path may contain non existing directories and files.
|
| |
| std::string | Execute (const char *command, const size_t buffer_size=128) |
| | Executes command as if it was called from the command line. More...
|
| |
|
int | RunExe (const std::string &exe_path, const std::string &cmd_arguments="") |
| | Runs executable in command line.
|
| |
| std::string | StripExtension (const std::string &file_name_with_extension) |
| | Strips the extension from a file name. More...
|
| |
| bool | FileExistsInDirectory (const std::string &dir_path, const std::string &filename, bool strip_extension=false) |
| | Checks whether a specified file exists in directory. More...
|
| |
An essential interface for manipulation with files and directories. Wraps file managing system calls.