| 261 | } |
| 262 | |
| 263 | string get_cache_name(const string &filename) |
| 264 | { |
| 265 | string::size_type pos = filename.rfind(FILE_SEPARATOR); |
| 266 | while (pos != string::npos && filename.find("/des", pos) != pos) |
| 267 | pos = filename.rfind(FILE_SEPARATOR, pos - 1); |
| 268 | if (pos != string::npos) |
| 269 | return replace_all_of(filename.substr(pos + 5), " /\\:", "_"); |
| 270 | #ifdef ALT_FILE_SEPARATOR |
| 271 | pos = filename.rfind(ALT_FILE_SEPARATOR); |
| 272 | while (pos != string::npos && filename.find("/des", pos) != pos) |
| 273 | pos = filename.rfind(ALT_FILE_SEPARATOR, pos - 1); |
| 274 | if (pos != string::npos) |
| 275 | return replace_all_of(filename.substr(pos + 5), " /\\:", "_"); |
| 276 | #endif |
| 277 | return filename; |
| 278 | } |
| 279 | |
| 280 | bool is_absolute_path(const string &path) |
| 281 | { |
no test coverage detected