|
Bifrost SDK
Bifrost SDK documentation
|
Functions | |
| bool | Bifrost::FileUtils::isAbsolute (Amino::StringView path) |
| Checks if a path is absolute. More... | |
| bool | Bifrost::FileUtils::createDirectories (Amino::StringView path, Amino::String *errorMessage=nullptr) |
| Creates the directories in path that do not exist. More... | |
| bool | Bifrost::FileUtils::currentPath (Amino::String ¤tPath, Amino::String *errorMessage=nullptr) |
| Returns the current path. More... | |
| Amino::String | Bifrost::FileUtils::extractParentPath (Amino::StringView path) |
| Returns the parent path of path. The input is first processed by makePreferred. Then the extraction follows C++17 std::filesystem. More... | |
| Amino::String | Bifrost::FileUtils::makePreferred (Amino::StringView path) |
| Convert directory separator characters in the given string to the operating system's preferred character. (For unix systems this is a forward slash, and for Windows, a backslash) More... | |
| Amino::String | Bifrost::FileUtils::filePath (Amino::StringView directory, Amino::StringView filename) |
| Create a file path from a directory and an filename in an operating system / independent way. More... | |
| Amino::String | Bifrost::FileUtils::filename (Amino::StringView baseName, long long frame, Amino::StringView targetExtension) |
| Construct a file name with the specified frame number and extension. If the file name contains # or @ they will be replaced with the given frame number. # will reserve 4 digits for the frame number, whereas @ will reserve just one. If a target file extension is specified it will be enforced, otherwise will be ignored. More... | |
| Amino::String | Bifrost::FileUtils::extractFilename (Amino::StringView filePath) |
| Get the filename (with extension) from a file path. The input is first processed by makePreferred. Then the extraction follows C++17 std::filesystem. More... | |
| bool | Bifrost::FileUtils::filePathExists (Amino::StringView filePath, Amino::String *out_errorMessage=nullptr) |
| Verify if a file path exists. More... | |
| Amino::String | Bifrost::FileUtils::getRelativePath (Amino::StringView path, Amino::StringView baseDirectory) |
| Return the valid relative path of the input path with respect to baseDirectory. More... | |
| bool | Bifrost::FileUtils::exists (Amino::StringView path, Amino::String *errorMessage=nullptr) |
| Verify if a path exists. More... | |
| bool | Bifrost::FileUtils::tempDirectoryPath (Amino::String &tempDirectoryPath, Amino::String *errorMessage=nullptr) |
| Returns the directory location suitable for temporary files. More... | |
| bool | Bifrost::FileUtils::removeAll (Amino::StringView path, Amino::String *errorMessage=nullptr) |
File utilities.
| bool Bifrost::FileUtils::createDirectories | ( | Amino::StringView | path, |
| Amino::String * | errorMessage = nullptr |
||
| ) |
Creates the directories in path that do not exist.
| [in] | path | The path of directories to create |
| [out] | errorMessage | On failure, errorMessage will be set to a human-readable error message |
| bool Bifrost::FileUtils::currentPath | ( | Amino::String & | currentPath, |
| Amino::String * | errorMessage = nullptr |
||
| ) |
Returns the current path.
The current path as returned by many operating systems is a dangerous global variable. It may be changed unexpectedly by a third-party or system library functions, or by another thread.
| [out] | currentPath | Will be set to the current path |
| [out] | errorMessage | On failure, errorMessage will be set to a human-readable error message |
| bool Bifrost::FileUtils::exists | ( | Amino::StringView | path, |
| Amino::String * | errorMessage = nullptr |
||
| ) |
Verify if a path exists.
This will return true if the path exists no matter whether it is a directory, file, symlink etc.
| [in] | path | The path. |
| [out] | errorMessage | On failure, errorMessage will be set to a human-readable error message |
| Amino::String Bifrost::FileUtils::extractFilename | ( | Amino::StringView | filePath | ) |
Get the filename (with extension) from a file path. The input is first processed by makePreferred. Then the extraction follows C++17 std::filesystem.
| [in] | filePath | The file path. |
| Amino::String Bifrost::FileUtils::extractParentPath | ( | Amino::StringView | path | ) |
Returns the parent path of path. The input is first processed by makePreferred. Then the extraction follows C++17 std::filesystem.
| [in] | path | The input path. |
| Amino::String Bifrost::FileUtils::filename | ( | Amino::StringView | baseName, |
| long long | frame, | ||
| Amino::StringView | targetExtension | ||
| ) |
Construct a file name with the specified frame number and extension. If the file name contains # or @ they will be replaced with the given frame number. # will reserve 4 digits for the frame number, whereas @ will reserve just one. If a target file extension is specified it will be enforced, otherwise will be ignored.
| [in] | baseName | The file name. |
| [in] | frame | The frame. |
| [in] | targetExtension | The desired extension of the file. |
| Amino::String Bifrost::FileUtils::filePath | ( | Amino::StringView | directory, |
| Amino::StringView | filename | ||
| ) |
Create a file path from a directory and an filename in an operating system / independent way.
| [in] | directory | directory name |
| [in] | filename | file name |
| bool Bifrost::FileUtils::filePathExists | ( | Amino::StringView | filePath, |
| Amino::String * | out_errorMessage = nullptr |
||
| ) |
Verify if a file path exists.
| [in] | filePath | The file path. |
| [out] | out_errorMessage | On failure, errorMessage will be set to a human-readable error message |
| Amino::String Bifrost::FileUtils::getRelativePath | ( | Amino::StringView | path, |
| Amino::StringView | baseDirectory | ||
| ) |
Return the valid relative path of the input path with respect to baseDirectory.
Note: If a file path (instead of directory) is passed in baseDirectory parameter the behavior is undefined
| [in] | path | The path that needs to be processed. |
| [in] | baseDirectory | Base directory used to build the relative path (relative to). |
| bool Bifrost::FileUtils::isAbsolute | ( | Amino::StringView | path | ) |
Checks if a path is absolute.
| [in] | path | The path to check. |
| Amino::String Bifrost::FileUtils::makePreferred | ( | Amino::StringView | path | ) |
Convert directory separator characters in the given string to the operating system's preferred character. (For unix systems this is a forward slash, and for Windows, a backslash)
| [in] | path | The path to convert |
| bool Bifrost::FileUtils::removeAll | ( | Amino::StringView | path, |
| Amino::String * | errorMessage = nullptr |
||
| ) |
Recursively deletes the contents on path.
Deletes the contents of path (if it is a directory) and the contents of all its subdirectories, recursively, then deletes path itself as if by repeatedly applying the POSIX remove. Symlinks are not followed (symlink is removed, not its target).
| [in] | path | The path. |
| [out] | errorMessage | On failure, errorMessage will be set to a human-readable error message |
| bool Bifrost::FileUtils::tempDirectoryPath | ( | Amino::String & | tempDirectoryPath, |
| Amino::String * | errorMessage = nullptr |
||
| ) |
Returns the directory location suitable for temporary files.
| [out] | tempDirectoryPath | Will be set to temporary directory path. |
| [out] | errorMessage | On failure, errorMessage will be set to a human-readable error message |