| 559 | } |
| 560 | |
| 561 | bool 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 | |
| 585 | bool FileSystem::IsFolder(const string& path) { |
| 586 | return path.empty() || path.back()=='/' || path.back()=='\\'; |