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

Function IsAbsolutePath

src/benchmark/Performance.cpp:113–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool IsAbsolutePath(const std::string& path) {
114 if (path.empty()) {
115 return false;
116 }
117#ifdef _WIN32
118 return path.size() > 2 &&
119 ((path[0] >= 'A' && path[0] <= 'Z') ||
120 (path[0] >= 'a' && path[0] <= 'z')) &&
121 path[1] == ':' && (path[2] == '/' || path[2] == '\\');
122#else
123 return path[0] == '/';
124#endif
125}
126
127std::string JoinPath(const std::string& directory, const std::string& child) {
128 if (directory.empty()) {

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected