MCPcopy Create free account
hub / github.com/crawl/crawl / get_cache_name

Function get_cache_name

crawl-ref/source/files.cc:263–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263string 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
280bool is_absolute_path(const string &path)
281{

Callers 2

set_fileMethod · 0.85
_parse_mapsFunction · 0.85

Calls 3

replace_all_ofFunction · 0.85
substrMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected