Veethree D7 SDK
Loading...
Searching...
No Matches
file_utils.h File Reference

Detailed Description

Utilities for file manipulation.

#include <string>
#include <string_view>
#include <sys/stat.h>
#include <system_error>
Include dependency graph for file_utils.h:

Go to the source code of this file.

Namespaces

namespace  vsdk
 Any entities that belong to the Veethree SDK libraries.
namespace  vsdk::utils
 Any entities that belong to the utils library.

Concepts

concept  vsdk::utils::StringLike
 Type constraint for string-like types.

Functions

std::string vsdk::utils::path_separator (const StringLike auto &base)
 Utility for prepending OS-specific path separator. Needed for the path_join function.
template<StringLike... Components>
std::string vsdk::utils::path_join (const StringLike auto &base, Components... comp)
 Utility to construct OS-aware paths. Similar to Python's os.path.join(). On Windows the path components will be joined by with backslashes (), everywhere else with forward slashed (/).
std::errc vsdk::utils::file_remove (const std::string &path)
 Remove a file.
std::errc vsdk::utils::mkdir (const std::string &path)
 Make a directory. This behaves as mkdir -p. It will create intermediary path components automatically.
std::errc vsdk::utils::rmdir (const std::string &path)
 Delete a directory recursively. Behaves as rm -rf.
std::string vsdk::utils::canonical_path (const std::string &path)
 Get the canonical path. The canonical path will not contain dot, dotdot or symlinks.
std::string vsdk::utils::temp_directory_path ()
 Get the path for the temp directory on the OS. Similar semantics to std::filesystem::temp_directory_path.
bool vsdk::utils::file_exists (const std::string &path)
 Utility to check if a path exists. Same semantics as std::filesystem::exists, but won't do character conversion on Windows.

Detailed Description

Utilities for file manipulation.