MCPcopy Create free account
hub / github.com/catboost/catboost / ConCatPathFileName

Function ConCatPathFileName

contrib/libs/flatbuffers/src/util.cpp:298–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298std::string ConCatPathFileName(const std::string &path,
299 const std::string &filename) {
300 std::string filepath = path;
301 if (filepath.length()) {
302 char &filepath_last_character = filepath.back();
303 if (filepath_last_character == kPathSeparatorWindows) {
304 filepath_last_character = kPathSeparator;
305 } else if (filepath_last_character != kPathSeparator) {
306 filepath += kPathSeparator;
307 }
308 }
309 filepath += filename;
310 // Ignore './' at the start of filepath.
311 if (filepath[0] == '.' && filepath[1] == kPathSeparator) {
312 filepath.erase(0, 2);
313 }
314 return filepath;
315}
316
317std::string PosixPath(const char *path) {
318 std::string p = path;

Callers 2

DoParseMethod · 0.85

Calls 3

lengthMethod · 0.45
backMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected