hecl
High-Level Extensible Combiner Language and Resource Database
|
Canonicalized project path representation using POSIX conventions. More...
#include <HECL.hpp>
Public Types | |
enum | PathType { PT_NONE, PT_FILE, PT_DIRECTORY, PT_GLOB } |
Type of path. More... | |
Public Member Functions | |
ProjectPath (const ProjectRootPath &rootPath, const SystemString &path) | |
Construct a project subpath representation. More... | |
bool | isRoot () const |
Determine if ProjectPath represents project root directory. More... | |
const SystemString & | getAbsolutePath () const |
Access fully-canonicalized absolute path. More... | |
const SystemString & | getRelativePath () const |
Access fully-canonicalized project-relative path. More... | |
const std::string & | getAbsolutePathUTF8 () const |
Access fully-canonicalized absolute path in UTF-8. More... | |
const std::string & | getRelativePathUTF8 () const |
PathType | getPathType () const |
Get type of path based on syntax and filesystem queries. More... | |
Time | getModtime () const |
Get time of last modification with special behaviors for directories and glob-paths. More... | |
void | getGlobResults (std::vector< SystemString > &outPaths) const |
Insert glob matches into existing vector. More... | |
size_t | hash () const |
C++11 compatible runtime hash (NOT USED IN PACKAGES!!) More... | |
bool | operator== (const ProjectPath &other) const |
bool | operator!= (const ProjectPath &other) const |
Protected Member Functions | |
bool | _canonAbsPath (const SystemString &path) |
Protected Attributes | |
SystemString | m_absPath |
SystemString | m_relPath |
size_t | m_hash = 0 |
Canonicalized project path representation using POSIX conventions.
HECL uses POSIX-style paths (with '/' separator) and directory tokens ('.','..') to resolve files within a project. The database internally uses this representation to track working files.
This class provides a convenient way to resolve paths relative to the project root. Part of this representation involves resolving symbolic links to regular file/directory paths and determining its type.
NOTE THAT PROJECT PATHS ARE TREATED AS CASE SENSITIVE!!
HECL::ProjectPath::ProjectPath | ( | const ProjectRootPath & | rootPath, |
const SystemString & | path | ||
) |
Construct a project subpath representation.
rootPath | previously constructed ProjectRootPath held by HECLDatabase::IProject |
path | valid filesystem-path (relative or absolute) to subpath |
|
inline |
Access fully-canonicalized absolute path.
|
inline |
Access fully-canonicalized absolute path in UTF-8.
void HECL::ProjectPath::getGlobResults | ( | std::vector< SystemString > & | outPaths | ) | const |
Insert glob matches into existing vector.
outPaths | Vector to add matches to (will not erase existing contents) |
Time HECL::ProjectPath::getModtime | ( | ) | const |
Get time of last modification with special behaviors for directories and glob-paths.
Regular files simply return their modtime as queried from the OS Directories return the latest modtime of all first-level regular files Glob-paths return the latest modtime of all matched regular files
PathType HECL::ProjectPath::getPathType | ( | ) | const |
Get type of path based on syntax and filesystem queries.
|
inline |
Access fully-canonicalized project-relative path.
|
inline |
C++11 compatible runtime hash (NOT USED IN PACKAGES!!)
|
inline |
Determine if ProjectPath represents project root directory.