Filesystem.hh
Go to the documentation of this file.
bool removeAll(const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Remove a file or a directory and all its contents.
bool removeDirectoryOrFile(const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Remove an empty directory or file.
void changeToUnixPath(std::string &_path)
Replace the preferred directory separator of the current operating system with a forward-slash '/'...
std::string parentPath(const std::string &_path)
Given a path, get just its parent path portion, without separator at the end.
std::string basename(const std::string &_path)
Given a path, get just the basename portion.
bool copyDirectory(const std::string &_existingDirname, const std::string &_newDirname, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Copy a directory, overwrite the destination directory if exists.
void changeFromUnixPath(std::string &_path)
Replace forward-slashes '/' with the preferred directory separator of the current operating system...
A class for iterating over all items in a directory.
Definition: Filesystem.hh:253
std::string copyToUnixPath(const std::string &_path)
Returns a copy of _path which has been passed through changeToUnixPath.
bool removeDirectory(const std::string &_path, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Remove an empty directory.
bool copyFile(const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Copy a file.
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: SuppressWarning.hh:67
std::string const separator(std::string const &_s)
Append the preferred path separator character for this platform onto the passed-in string...
STL class.
bool createDirectories(const std::string &_path)
Create directories for the given path.
bool moveFile(const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Move a file.
std::string copyFromUnixPath(const std::string &_path)
Returns a copy of _path which has been passed through changeFromUnixPath.
Errors that occur during filesystem manipulation should be logged as warnings using ignwarn...
Definition: Filesystem.hh:37
std::string uniqueDirectoryPath(const std::string &_dir)
Unique directory path to not overwrite existing directory.
std::string joinPaths(const std::string &_path1, const std::string &_path2)
Join two strings together to form a path.
std::string uniqueFilePath(const std::string &_pathAndName, const std::string &_extension)
Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i...
bool exists(const std::string &_path)
Determine whether the given path exists on the filesystem.
bool isDirectory(const std::string &_path)
Determine whether the given path is a directory.
Errors that occur during filesystem manipulation should not be logged. The user will be responsible f...
Definition: Filesystem.hh:42
bool removeFile(const std::string &_existingFilename, const FilesystemWarningOp _warningOp=FSWO_LOG_WARNINGS)
Remove a file.
FilesystemWarningOp
Options for how to handle errors that occur in functions that manipulate the filesystem.
Definition: Filesystem.hh:33
bool createDirectory(const std::string &_path)
Create a new directory on the filesystem. Intermediate directories must already exist.
std::string absPath(const std::string &_path)
Get the absolute path of a provided path.
Forward declarations for the common classes.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: SuppressWarning.hh:64