MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ParsedPath

Class ParsedPath

src/common/config/dir_list.h:39–70  ·  view source on GitHub ↗

This class is used internally by DirectoryList to store single path in format of pre-parsed elements of that path & perform basic operations with this path representation. Because of it's internal nature it has only internally required subset of possible operators.

Source from the content-addressed store, hash-verified

37// internally required subset of possible operators.
38//
39class ParsedPath : public ObjectsArray<PathName>
40{
41 typedef ObjectsArray<PathName> inherited;
42public:
43 explicit ParsedPath(MemoryPool& p) : ObjectsArray<PathName>(p) { }
44 ParsedPath(MemoryPool& p, const PathName& path)
45 : ObjectsArray<PathName>(p)
46 {
47 parse(path);
48 }
49 ParsedPath() : ObjectsArray<PathName>() { }
50 explicit ParsedPath(const PathName& path)
51 : ObjectsArray<PathName>()
52 {
53 parse(path);
54 }
55 // Take new path inside
56 void parse(const PathName& path);
57 // Convert internal representation to traditional one
58 operator PathName() const;
59 // Compare with path given by constant
60 bool operator==(const char* path) const
61 {
62 return this->operator PathName() == path;
63 }
64 // Check, whether pPath lies inside directory tree,
65 // specified by *this ParsedPath. Also checks against
66 // possible symbolic links.
67 bool contains(const ParsedPath& pPath) const;
68 // Returns path, containing elements from 0 to n-1
69 PathName subPath(FB_SIZE_T n) const;
70};
71
72
73class DirectoryList : public ObjectsArray<ParsedPath>

Callers 1

initializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected