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

Function ParentDirectory

src/tools/PlatformIO.cpp:47–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46#ifdef _WIN32
47std::wstring ParentDirectory(const std::wstring& fileName) {
48 const size_t slash = fileName.find_last_of(L"\\/");
49 if (slash == std::wstring::npos) {
50 return L".\\";
51 }
52 return fileName.substr(0, slash + 1);
53}
54#else
55std::string ParentDirectory(const std::string& fileName) {
56 const size_t slash = fileName.find_last_of('/');

Callers 1

CreateTempFileNearUtf8Function · 0.70

Calls 1

substrMethod · 0.45

Tested by

no test coverage detected