xentara-utils v1.1
Xentara utilities library
|
File systen tools. More...
Namespaces | |
namespace | path |
Filesystem path functionality. | |
Classes | |
class | StandardPathIterator |
An iterator that traverses all directories in a standard system search path. More... | |
Enumerations | |
enum class | StandardPath { Config , Data } |
Standard system search paths. More... | |
Functions | |
auto | replace (const std::filesystem::path &oldPath, const std::filesystem::path &newPath) -> void |
Replaces one file with another, preserving the properties. More... | |
auto | replace (const std::filesystem::path &oldPath, const std::filesystem::path &newPath, std::error_code &errorCode) noexcept -> void |
Replaces one file with another, preserving the properties. More... | |
auto | begin (StandardPath path) -> StandardPathIterator |
Gets a begin iterator for a standard path. More... | |
auto | end (StandardPath) -> std::default_sentinel_t |
Gets an end iterator for a standard path. More... | |
File systen tools.
This namespace contains facilities used for file system access in conjunbction with the std::filesystem namespace.
|
strong |
Standard system search paths.
This iterator supplies freestanding [begin()](xentara::utils::windows::wmi::begin(StandardPath)) and [end()](xentara::utils::windows::wmi::end(StandardPath)) functions, so they can be used in range-based for loops to iterate over the directories in the path without manually creating a StandardPathIterator:
Enumerator | |
---|---|
Config | Search path for configuration files. |
Data | Search path for data files. |
auto xentara::utils::filesystem::begin | ( | StandardPath | path | ) | -> StandardPathIterator |
Gets a begin iterator for a standard path.
This function enables the use of StandardPath in range-based for loops
path | The type of path to iterate over |
auto xentara::utils::filesystem::end | ( | StandardPath | ) | -> std::default_sentinel_t |
Gets an end iterator for a standard path.
This function enables the use of StandardPath in range-based for loops
auto xentara::utils::filesystem::replace | ( | const std::filesystem::path & | oldPath, |
const std::filesystem::path & | newPath | ||
) | -> void |
Replaces one file with another, preserving the properties.
This function renames the file oldPath to newPath similar to std::filesystem::rename(). However, the file will inherit all properties, like creation time, access mode, etc., from an existing file already located at newPath.
oldPath | The current path of the file |
newPath | The new path for the file. There must already be an existing file at this path. |
|
noexcept |
Replaces one file with another, preserving the properties.
This function renames the file oldPath to newPath similar to std::filesystem::rename(). However, the file will inherit all properties, like creation time, access mode, etc., from an existing file already located at newPath.
oldPath | The current path of the file |
newPath | The new path for the file. There must already be an existing file at this path. |
errorCode | Receives the error code on error. On success, errorCode.clear() is called. |