![]() |
VR-Forces 5.0.2 Developer's Guide
|
The DtVrvFilesystem is a wrapper around boost functions that are know to throw exceptions. These functions are all reentrent* however the working directory should not be changed.
Static Public Member Functions | |
| static bool | createAllDirectories (const std::string &dirPath) |
| static std::string | absolutePath (const std::string &path) |
| static DtUnicode | absolutePath (const DtUnicode &path) |
| static std::string | cleanPath (const std::string &path) |
| static DtUnicode | cleanPath (const DtUnicode &path) |
| static bool | getFilePathsWithExtension (const std::string &rootDir, const std::string &ext, std::vector< std::string > &ret) |
| static bool | getFilePathsWithExtension (const std::vector< std::string > &fileOrDirVec, const std::string &ext, std::vector< std::string > &ret) |
| static bool | getFilePathsInDir (const std::string &rootDir, std::vector< std::string > &ret) |
| static bool | dirExistsNotEmpty (const std::string &rootDir) |
| static bool | isAbsolutePath (const std::string &path) |
| static bool | exists (const std::string &path) |
| static std::string | fileName (const std::string &path) |
| static bool | exists (const boost::filesystem::path &path) |
| static bool | equivalent (const std::string &path1, const std::string &path2) |
| static std::string | makeRelative (const std::string &root, const std::string &path) |
| static std::string | setExtension (std::string file, std::string ext) |
| static std::string | addExtension (std::string file, std::string ext) |
| static std::string | extension (const std::string &file, bool withDot=false) |
| static std::string | extensionCaseSensitive (std::string file, bool withDot=false) |
| static std::string | baseName (const std::string &file) |
| static std::string | directoryOfFile (const std::string &file) |
| static std::string | directoryOfPath (const std::string &file) |
| static std::string | rootDirectoryOfPath (const std::string &file) |
| static std::string | nativePath (const std::string &path) |
| static DtUnicode | nativePath (const DtUnicode &path) |
| static bool | is_directory (const std::string &path) |
| static bool | is_directory (const boost::filesystem::path &path) |
| static bool | deleteFile (const std::string &file) |
| static bool | deleteDirectory (const std::string &dir) |
| template<typename PathCollection > | |
| static bool | findFile (const std::string &filePathIn, const PathCollection &paths, std::string &actualFilePathOut) |
| static bool | findFileInPath (const std::string &filePathIn, const std::string &path, std::string &actualFilePathOut) |
| static unsigned int | makeAndXorHash (const std::string &filePath) |
| static size_t | ts_fileSize (const std::string &strFileName) |
| static bool | ts_fileExists (const std::string &strFileName) |
| static void | ts_readFileIntoBuffer (const std::string &strFileName, unsigned char *&pData, size_t &size) |
|
static |
Creates all the directories from parent to child.
| [in] | dirPath | is the directory path to create. |
| true | if the directory path was successfully constructed. |
| false | otherwise. |
|
static |
Get an absolute path from a relative path. This function resolves a relative path to an absolute path and converts inconsistent slashes to the native format.
| [in] | path | is the relative path to convert. |
Get an absolute path from a relative path. This function resolves a relative path to an absolute path and converts inconsistent slashes to the native format.
| [in] | path | is the relative path to convert. |
|
static |
Clean a path by resolving embedded relative parts and correcting for inconsistent slashes.
| [in] | path | is the relative or absolute path to clean. |
Clean a path by resolving embedded relative parts and correcting for inconsistent slashes.
| [in] | path | is the relative or absolute path to clean. |
|
static |
Given a path and an extension, return a vector of file paths ex. c:*.jpg -> "c:\adir\a.jpg", "c:\adir\b.jpg" ... for files that match that extension.
| [in] | dir | is the relative or absolute dir |
| [in] | ext | is the file extension to look for (ex. 'jpg') |
| [out] | ret | is a list of file paths that have the extension |
| true | if at least one file was found |
| false | it no files were found |
|
static |
Given a vector of paths (file or dir) and an extension, return a vector of file paths ex. ext="jpg" 'c:\','c:.bmp','c:.jpg' -> "c:\adir\a.jpg", "c:\b.jpg" ... for files that match that extension.
| [in] | vector | of files or dirs (relative or absolute dirs) |
| [in] | ext | is the file extension to look for (ex. 'jpg') |
| [out] | ret | is a list of file paths that have the extension |
| true | if at least one file was found |
| false | it no files were found |
|
static |
Given a path return a vector of files paths underneath a directory ex. c:\ -> "c:\adir\a.jpg", "c:\adir\b.jpg" ...
| [in] | path | is the relative or absolute path |
| [out] | ret | is a list of file paths found |
| true | if at least one file was found |
| false | it no files were found |
|
static |
Given a directory return if the directory exists and is not empty.
| [in] | dir | is the relative or absolute path |
| true | if at least one file was found |
| false | it no files were found |
|
static |
Check if the given path is an absolute path.
| [in] | path | is the path to check. |
| true | if the given path is already absolute. |
| false | otherwise or failure to check. |
|
static |
Check if the given path is exists.
| [in] | path | is the path to check. |
| true | if the given path exists in the filesystem. |
| false | otherwise or failure to check. |
Referenced by makVrv::DtManagerBackup< Manager >::backupDirExists(), makVrv::DtManagerBackup< Manager >::backupFileExists(), makVrv::DtManagerBackup< Manager >::factoryDirExists(), makVrv::DtManagerBackup< Manager >::factoryFileExists(), and findFile().
|
static |
| [in] | path | is the (possibly) full/relative path with file name |
| file | name including extension |
|
static |
Check if the given path is exists.
| [in] | path | is the path to check. |
| true | if the given path exists in the filesystem. |
| false | otherwise or failure to check. |
|
static |
Check if the two given paths are equivalent. This checks that two given paths, whether relative or absolute, both resolve to the same directory or file location.
| [in] | path1 | is the first path to check. |
| [in] | path2 | is the second path to check. |
| true | if both paths resolve to the same location. |
| false | otherwise or failure to check. |
|
static |
Resolve a given path into a relative path based on a specific root. Using a root path location, a given path is converted to a new path relative to that root location.
For example: if the root is "C:\test" and path is "C:\temp\file.txt", the resulting path returned would be "..\file.txt".
The given root and given path values can be relative or absolute file or directory paths. If relative paths are given they are first converted to absolute paths from the current working directory.
| [in] | root | is the root path to base the relative path from. |
| [in] | path | is the path to convert to a relative path. |
|
static |
Set a new extension to a file name. If an extension already exists, it is changed to the new extension. If the file does not have an extension the new extension is appended.
| [in] | file | is the path or name of the file. |
| [in] | ext | is the extension to set on the filename. |
|
static |
Append a new extension to a file name. If an existing extension to the file is the same as the given extension, the file is returned unchanged. If the given file or extension are invalid values, the file is returned unchanged.
| [in] | file | is the path or name of the file. |
| [in] | ext | is the extension to append to the filename. |
|
static |
Get the extension from a file path. The case of the returned extension is converted to lowercase.
| [in] | file | is the path or name of the file. |
| [in] | withDot | is a flag indicating the extension should or should not include the leading dot character. |
|
static |
Get the extension from a file path. The case of the returned extension is preserved.
| [in] | file | is the path or name of the file. |
| [in] | withDot | is a flag indicating the extension should or should not include the leading dot character. |
|
static |
Get the base name of a file, excluding the file path and extension.
For example: ...txt -> test
| [in] | file | is the path or name of the file. |
|
static |
Get the directory path containing the existing file.
For example: ...txt -> ..
| [in] | file | is the path and name of the file. |
|
static |
Get the directory path of a file.
For example: ...txt -> ..
| [in] | file | is the path and name of the file. |
|
static |
Get the root of the given directory.
For example: data\file\test.text -> data
| [in] | file | is the file path to get the root directory from |
|
static |
Convert the path to the native format of the platform.
| [in] | path | is the path to be converted. |
Convert the path to the native format of the platform.
| [in] | path | is the path to be converted. |
|
static |
Test whether the path is a directory or not.
| [in] | path | is the path to be tested. |
| true | if the path is a directory and exists. |
| false | otherwise. |
|
static |
Test whether the path is a directory or not.
| [in] | path | is the path to be tested. |
| true | if the path is a directory and exists. |
| false | otherwise. |
|
static |
Delete the given file.
| [in] | file | is the file to be deleted. |
| true | if the file was successfully deleted. |
| false | otherwise. |
Referenced by makVrv::DtManagerBackup< Manager >::deleteBackup().
|
static |
Delete the given directory.
| [in] | dir | is the directory to be deleted. |
| true | if the file was successfully deleted. |
| false | otherwise. |
|
inlinestatic |
Find a file in a list of paths. Iterate through a list of paths and attempt to find a file within one of the paths. The first location found in the iteration is returned.
| [in] | filePathIn | is a file or filepath to find. |
| [in] | paths | is a list of paths to check for the file. |
| [out] | actualFilePathOut | is the filepath where the file was found. |
| true | if the file exists and was found in one of the paths. |
| false | otherwise. |
References exists().
|
static |
Find the file in a path. This test tries to find an existing file in a given path. The given filepath is first tested as is within the given path, and on failure, the the filename (stripped of any file path) is then tested within the given path.
| [in] | filePathIn | is a file or filepath to find. |
| [in] | path | is the path to check for the file or filepath. |
| [out] | actualFilePathOut | is the filepath where the file was found. |
| true | if the file exists and was found. |
| false | otherwise. |
utility function
|
static |
thread safe
|
static |
thread safe
|
static |
thread safe client must delete