MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / readFile

Method readFile

src/common/BzVFS.cpp:643–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641
642
643bool 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
668bool BzVFS::writeFile(const std::string& path, const std::string& modes,

Callers 5

ParseMethod · 0.45
LoadSourceCodeMethod · 0.45
ReadImageFileMethod · 0.45
ReadFileMethod · 0.45
IncludeMethod · 0.45

Calls 2

clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected