MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / ConCatPathFileName

Function ConCatPathFileName

native/thirdpart/flatbuffers/util.cpp:155–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155std::string ConCatPathFileName(const std::string &path,
156 const std::string &filename) {
157 std::string filepath = path;
158 if (filepath.length()) {
159 char &filepath_last_character = string_back(filepath);
160 if (filepath_last_character == kPathSeparatorWindows) {
161 filepath_last_character = kPathSeparator;
162 } else if (filepath_last_character != kPathSeparator) {
163 filepath += kPathSeparator;
164 }
165 }
166 filepath += filename;
167 // Ignore './' at the start of filepath.
168 if (filepath[0] == '.' && filepath[1] == kPathSeparator) {
169 filepath.erase(0, 2);
170 }
171 return filepath;
172}
173
174std::string PosixPath(const char *path) {
175 std::string p = path;

Callers 2

DoParseMethod · 0.85
CompileMethod · 0.85

Calls 2

string_backFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected