| 296 | } |
| 297 | |
| 298 | std::string ConCatPathFileName(const std::string &path, |
| 299 | const std::string &filename) { |
| 300 | std::string filepath = path; |
| 301 | if (filepath.length()) { |
| 302 | char &filepath_last_character = filepath.back(); |
| 303 | if (filepath_last_character == kPathSeparatorWindows) { |
| 304 | filepath_last_character = kPathSeparator; |
| 305 | } else if (filepath_last_character != kPathSeparator) { |
| 306 | filepath += kPathSeparator; |
| 307 | } |
| 308 | } |
| 309 | filepath += filename; |
| 310 | // Ignore './' at the start of filepath. |
| 311 | if (filepath[0] == '.' && filepath[1] == kPathSeparator) { |
| 312 | filepath.erase(0, 2); |
| 313 | } |
| 314 | return filepath; |
| 315 | } |
| 316 | |
| 317 | std::string PosixPath(const char *path) { |
| 318 | std::string p = path; |
no test coverage detected