MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / GenericFileSystem

Class GenericFileSystem

radiantcore/vfs/GenericFileSystem.h:50–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48/// \param file_type The data type which represents a file.
49template<typename RecordType>
50class GenericFileSystem
51{
52 class Path
53 {
54 private:
55 std::string _path;
56 unsigned int _depth;
57 public:
58 Path(const std::string& path) :
59 _path(path),
60 _depth(getPathDepth(_path.c_str()))
61 {}
62
63 Path(const char* start, std::size_t length) :
64 Path(std::string(start, length))
65 {}
66
67 bool operator<(const Path& other) const
68 {
69 return string_less_nocase(c_str(), other.c_str());
70 }
71
72 unsigned int depth() const
73 {
74 return _depth;
75 }
76
77 const char* c_str() const
78 {
79 return _path.c_str();
80 }
81
82 const std::string& string() const
83 {
84 return _path;
85 }
86 };
87
88public:
89 class Entry
90 {
91 std::shared_ptr<RecordType> _record;
92 public:
93 Entry()
94 {}
95
96 Entry(const std::shared_ptr<RecordType>& record) :
97 _record(record)
98 {}
99
100 std::shared_ptr<RecordType>& getRecord()
101 {
102 return _record;
103 }
104
105 bool isDirectory() const
106 {
107 return !_record;

Callers

nothing calls this directly

Calls 5

path_remove_directoryFunction · 0.85
value_typeClass · 0.85
EntryClass · 0.85
c_strMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected