| 641 | |
| 642 | |
| 643 | bool BzVFS::readFile(const std::string& path, const std::string& modes, |
| 644 | std::string& data) { |
| 645 | std::string outPath, outModes; |
| 646 | if (!parseModes(path, outPath, modes, outModes)) { |
| 647 | return false; |
| 648 | } |
| 649 | |
| 650 | const std::string cleanPath = cleanFilePath(outPath); |
| 651 | if (!safePath(cleanPath)) { |
| 652 | return false; |
| 653 | } |
| 654 | |
| 655 | std::vector<BzFS*> systems; |
| 656 | getSystems(outModes, systems); |
| 657 | |
| 658 | data.clear(); |
| 659 | for (size_t i = 0; i < systems.size(); i++) { |
| 660 | if (systems[i]->readFile(cleanPath, data)) { |
| 661 | return true; |
| 662 | } |
| 663 | } |
| 664 | return false; |
| 665 | } |
| 666 | |
| 667 | |
| 668 | bool BzVFS::writeFile(const std::string& path, const std::string& modes, |
no test coverage detected