| 154 | |
| 155 | |
| 156 | int ExtractFilePath(const string &file_path, string *dir, string *file_name) { |
| 157 | const auto pos(file_path.find_last_of("/")); |
| 158 | if (string::npos == pos) { |
| 159 | if (dir) { |
| 160 | *dir = ""; |
| 161 | } |
| 162 | if (file_name) { |
| 163 | *file_name = file_path; |
| 164 | } |
| 165 | } else { |
| 166 | if (dir) { |
| 167 | *dir = file_path.substr(0, pos - 1); |
| 168 | } |
| 169 | if (file_name) { |
| 170 | *file_name = file_path.substr(pos + 1); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | int RemoveFile(const string &file_path) { |
| 178 | int ret{0}; |
nothing calls this directly
no outgoing calls
no test coverage detected