| 90 | } |
| 91 | |
| 92 | std::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 | |
| 105 | std::string JoinPath(const std::string& left, const std::string& right) { |
| 106 | if (left.empty()) { |
no test coverage detected