| 111 | } |
| 112 | |
| 113 | bool IsAbsolutePath(const std::string& path) { |
| 114 | if (path.empty()) { |
| 115 | return false; |
| 116 | } |
| 117 | #ifdef _WIN32 |
| 118 | return path.size() > 2 && |
| 119 | ((path[0] >= 'A' && path[0] <= 'Z') || |
| 120 | (path[0] >= 'a' && path[0] <= 'z')) && |
| 121 | path[1] == ':' && (path[2] == '/' || path[2] == '\\'); |
| 122 | #else |
| 123 | return path[0] == '/'; |
| 124 | #endif |
| 125 | } |
| 126 | |
| 127 | std::string JoinPath(const std::string& directory, const std::string& child) { |
| 128 | if (directory.empty()) { |
no test coverage detected