MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / ResolveFileWithPaths

Method ResolveFileWithPaths

MonaBase/sources/FileSystem.cpp:561–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561bool FileSystem::ResolveFileWithPaths(const char* paths, string& file) {
562 string path;
563 String::ForEach forEach([&file,&path](UInt32 index,const char* value) {
564 path.assign(value);
565#if defined(_WIN32)
566 // "path" => path
567 if (!path.empty() && path[0] == '"' && path.back() == '"') {
568 path.erase(path.front());
569 path.resize(path.size()-1);
570 }
571#endif
572 if (Exists(MakeFolder(path).append(file))) {
573 file = move(path);
574 return false;
575 }
576 return true;
577 });
578#if defined(_WIN32)
579 return String::Split(paths, ";", forEach) == string::npos;
580#else
581 return String::Split(paths, ":", forEach) == string::npos;
582#endif
583}
584
585bool FileSystem::IsFolder(const string& path) {
586 return path.empty() || path.back()=='/' || path.back()=='\\';

Callers

nothing calls this directly

Calls 6

frontMethod · 0.80
resizeMethod · 0.80
emptyMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected