MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / JoinPath

Function JoinPath

src/benchmark/Performance.cpp:127–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127std::string JoinPath(const std::string& directory, const std::string& child) {
128 if (directory.empty()) {
129 return child;
130 }
131 const char last = directory[directory.size() - 1];
132 if (last == '/' || last == '\\') {
133 return directory + child;
134 }
135 return directory + "/" + child;
136}
137
138std::string GetParentDirectory(const std::string& path) {
139 const std::string::size_type pos = path.find_last_of("/\\");

Callers 1

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected