Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
Utf8 encoded path wrapper. More...
#include <foray_env.hpp>
Public Member Functions | |
Utf8Path (const Utf8Path &other) | |
Utf8Path (Utf8Path &&other) | |
Utf8Path & | operator= (const Utf8Path &other) |
Utf8Path () | |
Default constructs with empty relative path. | |
template<typename StringViewLike > | |
Utf8Path (const StringViewLike &path) | |
Utf8Path | operator/ (const Utf8Path &other) const |
Combine paths, interpreted as navigating relative of this path to the other path. | |
Utf8Path & | operator/= (const Utf8Path &other) |
Update this paths by navigating relative to self as dictated by other. | |
operator const std::string & () const | |
Gets the internally stored path. | |
operator const char * () const | |
Gets the internally stored path. | |
operator std::filesystem::path () const | |
Gets the internally stored path. | |
bool | operator== (const Utf8Path &other) const |
bool | operator!= (const Utf8Path &other) const |
bool | operator< (const Utf8Path &other) const |
bool | operator> (const Utf8Path &other) const |
bool | IsRelative () const |
Returns true, if the path is detected to be relative. | |
Utf8Path | MakeAbsolute () const |
Returns this path appended to the current working directory. | |
Protected Member Functions | |
void | VerifyPath () |
Detects absolute paths, and clears '../' and './' navigators where possible. | |
void | BuildSectionVector () |
Updates mPathSections. | |
Utf8Path (const std::vector< std::string_view > §ions, bool relative) | |
Builds mPath member by concatenating mPathSections. | |
Static Protected Member Functions | |
static void | sBuildFromSections (std::string &path, const std::vector< std::string_view > §ions) |
Builds a new path string (stored to path parameter) from sections. | |
Protected Attributes | |
std::string | mPath |
The stored path, encoded as UTF-8. | |
bool | mRelative |
If true, the path is a relative path. | |
std::vector< std::string_view > | mPathSections |
Directory and file names making up this path. References sections in mPath, result of splitting by '/'. May contain empty entries (for example absolute paths on unix systems) | |
Utf8 encoded path wrapper.
Versus std::filesystem::path:
|
protected |
Builds mPath member by concatenating mPathSections.
sections | mPathSections |
relative | mRelative |
|
inline |
|
inline |
foray::osi::Utf8Path::Utf8Path | ( | ) |
Default constructs with empty relative path.
|
inline |
|
protected |
Updates mPathSections.
bool foray::osi::Utf8Path::IsRelative | ( | ) | const |
Returns true, if the path is detected to be relative.
Detection:
Utf8Path foray::osi::Utf8Path::MakeAbsolute | ( | ) | const |
Returns this path appended to the current working directory.
foray::osi::Utf8Path::operator const char * | ( | ) | const |
Gets the internally stored path.
foray::osi::Utf8Path::operator const std::string & | ( | ) | const |
Gets the internally stored path.
foray::osi::Utf8Path::operator std::filesystem::path | ( | ) | const |
Gets the internally stored path.
bool foray::osi::Utf8Path::operator!= | ( | const Utf8Path & | other | ) | const |
Combine paths, interpreted as navigating relative of this path to the other path.
Update this paths by navigating relative to self as dictated by other.
bool foray::osi::Utf8Path::operator< | ( | const Utf8Path & | other | ) | const |
bool foray::osi::Utf8Path::operator== | ( | const Utf8Path & | other | ) | const |
bool foray::osi::Utf8Path::operator> | ( | const Utf8Path & | other | ) | const |
|
staticprotected |
Builds a new path string (stored to path parameter) from sections.
|
protected |
Detects absolute paths, and clears '../' and './' navigators where possible.
|
protected |
The stored path, encoded as UTF-8.
|
protected |
Directory and file names making up this path. References sections in mPath, result of splitting by '/'. May contain empty entries (for example absolute paths on unix systems)
|
protected |
If true, the path is a relative path.