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

Function ParentDir

plugins/jieba/src/JiebaSegmentationPlugin.cpp:92–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92std::string ParentDir(const std::string& path) {
93 std::string normalized = path;
94 while (!normalized.empty() &&
95 (normalized.back() == '/' || normalized.back() == '\\')) {
96 normalized.pop_back();
97 }
98 const std::string::size_type pos = normalized.find_last_of("/\\");
99 if (pos == std::string::npos) {
100 return "";
101 }
102 return normalized.substr(0, pos);
103}
104
105std::string JoinPath(const std::string& left, const std::string& right) {
106 if (left.empty()) {

Callers 1

ResolveResourcePathFunction · 0.70

Calls 3

emptyMethod · 0.45
pop_backMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected