| 153 | } |
| 154 | |
| 155 | std::string ConCatPathFileName(const std::string &path, |
| 156 | const std::string &filename) { |
| 157 | std::string filepath = path; |
| 158 | if (filepath.length()) { |
| 159 | char &filepath_last_character = string_back(filepath); |
| 160 | if (filepath_last_character == kPathSeparatorWindows) { |
| 161 | filepath_last_character = kPathSeparator; |
| 162 | } else if (filepath_last_character != kPathSeparator) { |
| 163 | filepath += kPathSeparator; |
| 164 | } |
| 165 | } |
| 166 | filepath += filename; |
| 167 | // Ignore './' at the start of filepath. |
| 168 | if (filepath[0] == '.' && filepath[1] == kPathSeparator) { |
| 169 | filepath.erase(0, 2); |
| 170 | } |
| 171 | return filepath; |
| 172 | } |
| 173 | |
| 174 | std::string PosixPath(const char *path) { |
| 175 | std::string p = path; |
no test coverage detected