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

Function GetParentDirectory

src/Config.cpp:690–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688};
689
690std::string GetParentDirectory(const std::string& path) {
691 size_t pos = path.rfind('/', path.length() - 1);
692 if (pos == std::string::npos) {
693 pos = path.rfind('\\', path.length() - 1);
694 }
695 if (pos == std::string::npos) {
696 return "";
697 }
698 return path.substr(0, pos + 1);
699}
700
701bool isRegularFile(const std::string& path) {
702#if defined(_WIN32) || defined(_WIN64)

Callers 2

NewFromFileMethod · 0.70

Calls 2

lengthMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected