HDK
|
#include <PDG_PathMap.h>
Classes | |
struct | Entry |
Public Types | |
enum | MatchType { eMatchContains, eMatchPrefix, eMatchSuffix } |
Enumeration of path map matching types. More... | |
using | EntryArray = UT_Array< Entry > |
Array of path mapping entries. More... | |
Public Member Functions | |
PDG_PathMap (int version) | |
bool | reload (bool merge, UT_WorkBuffer &errors) |
Reloads the path map instance from the environment. More... | |
const UT_StringHolder & | toString () const |
Returns a string representation of this path map. More... | |
bool | save (UT_WorkBuffer &buffer) const |
Saves the path map to the specified work buffer, in JSON format. More... | |
bool | load (const UT_StringHolder &path_map, bool update_vars, bool merge, UT_WorkBuffer &errors) |
Loads a path map from the input JSON string. More... | |
UT_StringHolder | mapPath (const UT_StringHolder &path, const UT_StringHolder &zone) const |
UT_StringHolder | mapPath (const UT_StringHolder &path) const |
const UT_StringHolder & | zone () const |
Returns the current zone for this path mapping instance. More... | |
void | setZone (const UT_StringHolder &zone) |
Sets the zone for this path mapping instance. More... | |
const EntryArray & | mappings () const |
void | filteredMappings (EntryArray &entries, const UT_StringHolder &zone, const UT_StringHolder &scheduler) const |
Returns the mapping entries for a specific zone and/or scheduler. More... | |
void | addPathMapping (const UT_StringHolder &zone, const UT_StringHolder &map_from, const UT_StringHolder &map_to, const UT_StringHolder &scheduler, MatchType match_type) |
Adds an entry to the path map. More... | |
void | clearSchedulerMappings (const UT_StringHolder &scheduler) |
Clears path mapping entries for the specified scheduler path. More... | |
void | clearAllMappings () |
Clears all path mapping entries. More... | |
void | commitPathMapping () |
Static Public Member Functions | |
static PDG_PathMap & | globalMap () |
Returns the shared global path mapping instance. More... | |
Static Public Attributes | |
static const UT_StringHolder | theWinZone |
Default zone for Windows systems – WIN. More... | |
static const UT_StringHolder | theMacZone |
Default zone for Mac systems – MAC. More... | |
static const UT_StringHolder | theLinuxZone |
Default zone for Linux systems – LINUX. More... | |
static const UT_StringHolder | theAllZone |
Special zone that matches with all platforms – *. More... | |
static const int | theVersion |
Current PDG Path Map data version. More... | |
static const UT_StringHolder | theAllSchedulerName |
Sepecial scheduler name that matches all schedulers. More... | |
Definition at line 26 of file PDG_PathMap.h.
using PDG_PathMap::EntryArray = UT_Array<Entry> |
Array of path mapping entries.
Definition at line 64 of file PDG_PathMap.h.
Enumeration of path map matching types.
Definition at line 30 of file PDG_PathMap.h.
PDG_PathMap::PDG_PathMap | ( | int | version | ) |
void PDG_PathMap::addPathMapping | ( | const UT_StringHolder & | zone, |
const UT_StringHolder & | map_from, | ||
const UT_StringHolder & | map_to, | ||
const UT_StringHolder & | scheduler, | ||
MatchType | match_type | ||
) |
Adds an entry to the path map.
void PDG_PathMap::clearAllMappings | ( | ) |
Clears all path mapping entries.
void PDG_PathMap::clearSchedulerMappings | ( | const UT_StringHolder & | scheduler | ) |
Clears path mapping entries for the specified scheduler path.
void PDG_PathMap::commitPathMapping | ( | ) |
Updates the internal string representation and env var for the path mapping.
void PDG_PathMap::filteredMappings | ( | EntryArray & | entries, |
const UT_StringHolder & | zone, | ||
const UT_StringHolder & | scheduler | ||
) | const |
Returns the mapping entries for a specific zone and/or scheduler.
|
static |
Returns the shared global path mapping instance.
bool PDG_PathMap::load | ( | const UT_StringHolder & | path_map, |
bool | update_vars, | ||
bool | merge, | ||
UT_WorkBuffer & | errors | ||
) |
Loads a path map from the input JSON string.
UT_StringHolder PDG_PathMap::mapPath | ( | const UT_StringHolder & | path, |
const UT_StringHolder & | zone | ||
) | const |
Applies the path mapping to the input path, using the desired mapping zone.
|
inline |
Applies the path mapping using the mapping zone from the current platform.
Definition at line 109 of file PDG_PathMap.h.
|
inline |
Returns the array of path mapping entries currently stored in this path map.
Definition at line 126 of file PDG_PathMap.h.
bool PDG_PathMap::reload | ( | bool | merge, |
UT_WorkBuffer & | errors | ||
) |
Reloads the path map instance from the environment.
bool PDG_PathMap::save | ( | UT_WorkBuffer & | buffer | ) | const |
Saves the path map to the specified work buffer, in JSON format.
|
inline |
Sets the zone for this path mapping instance.
Definition at line 118 of file PDG_PathMap.h.
const UT_StringHolder& PDG_PathMap::toString | ( | ) | const |
Returns a string representation of this path map.
|
inline |
Returns the current zone for this path mapping instance.
Definition at line 114 of file PDG_PathMap.h.
|
static |
Sepecial scheduler name that matches all schedulers.
Definition at line 82 of file PDG_PathMap.h.
|
static |
Special zone that matches with all platforms – *.
Definition at line 76 of file PDG_PathMap.h.
|
static |
Default zone for Linux systems – LINUX.
Definition at line 73 of file PDG_PathMap.h.
|
static |
Default zone for Mac systems – MAC.
Definition at line 70 of file PDG_PathMap.h.
Current PDG Path Map data version.
Definition at line 79 of file PDG_PathMap.h.
|
static |
Default zone for Windows systems – WIN.
Definition at line 67 of file PDG_PathMap.h.