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

Function ParentDirectory

plugins/jieba/tests/JiebaPluginIntegrationTest.cpp:94–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92namespace {
93
94std::string ParentDirectory(const std::string& path) {
95 const std::string::size_type pos = path.find_last_of("/\\");
96 if (pos == std::string::npos) {
97 return "";
98 }
99 return path.substr(0, pos);
100}
101
102bool IsReadableFile(const std::string& path) {
103 std::ifstream ifs(path.c_str());

Callers 3

DictionaryDirectoryMethod · 0.70
PluginDirectoryMethod · 0.70
MergedJiebaDictPathMethod · 0.70

Calls 1

substrMethod · 0.45

Tested by

no test coverage detected