MCPcopy Create free account
hub / github.com/crownengine/crown / reduce

Function reduce

src/core/filesystem/path.cpp:104–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 void reduce(DynamicString &clean, const char *path)
105 {
106 if (path == NULL)
107 return;
108
109 char cc = any_separator(*path) ? PATH_SEPARATOR : *path;
110 clean += cc;
111 ++path;
112
113 for (; *path; ++path) {
114 if (cc == PATH_SEPARATOR && any_separator(*path))
115 continue;
116
117 cc = any_separator(*path) ? PATH_SEPARATOR : *path;
118 clean += cc;
119 }
120
121 if (has_trailing_separator(clean.c_str()))
122 array::pop_back(clean._data);
123 }
124
125 bool expand(DynamicString &expanded, const char *path_template)
126 {

Callers 4

VisitExprMethod · 0.85
test_pathFunction · 0.85
absolute_pathMethod · 0.85
parseMethod · 0.85

Calls 3

any_separatorFunction · 0.85
has_trailing_separatorFunction · 0.85
c_strMethod · 0.45

Tested by 1

test_pathFunction · 0.68