MCPcopy Create free account
hub / github.com/apple/foundationdb / joinPath

Function joinPath

fdbmonitor/fdbmonitor.cpp:265–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265std::string joinPath(std::string const& directory, std::string const& filename) {
266 auto d = directory;
267 auto f = filename;
268 while (f.size() && (f[0] == '/' || f[0] == CANONICAL_PATH_SEPARATOR))
269 f = f.substr(1);
270 while (d.size() && (d.back() == '/' || d.back() == CANONICAL_PATH_SEPARATOR))
271 d = d.substr(0, d.size() - 1);
272 return d + CANONICAL_PATH_SEPARATOR + f;
273}
274
275std::string cleanPath(std::string const& path) {
276 std::vector<std::string> finalParts;

Callers 15

abspathFunction · 0.70
set_watchesFunction · 0.70
testPathOpsFunction · 0.70
mainFunction · 0.70
Future<int> runCliFunction · 0.50
openMethod · 0.50
existsMethod · 0.50
setupAndRunFunction · 0.50
filenameFromSampleFunction · 0.50

Calls 3

substrMethod · 0.80
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected