MCPcopy Create free account
hub / github.com/chen3feng/toft / DoJoin

Method DoJoin

storage/path/path.cpp:150–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150std::string Path::DoJoin(const std::string** paths, size_t size)
151{
152 std::string result = *paths[0];
153 for (size_t i = 1; i < size; ++i) {
154 const std::string& path = *paths[i];
155 if (!path.empty()) {
156 if (path[0] == '/') {
157 result = path;
158 } else {
159 if (!result.empty() && result[result.size() - 1] != '/')
160 result += '/';
161 result += path;
162 }
163 }
164 }
165 return result;
166}
167
168} // namespace toft
169

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected