MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / loadTextFromVfsFile

Function loadTextFromVfsFile

test/algorithm/FileUtils.h:59–74  ·  view source on GitHub ↗

Loads the entire text from the given vfs file into a string

Source from the content-addressed store, hash-verified

57
58// Loads the entire text from the given vfs file into a string
59inline std::string loadTextFromVfsFile(const std::string& vfsPath)
60{
61 auto file = GlobalFileSystem().openTextFile(vfsPath);
62
63 if (!file)
64 {
65 return std::string();
66 }
67
68 std::stringstream textStream;
69 std::istream mapStream(&file->getInputStream());
70 textStream << mapStream.rdbuf();
71 textStream.flush();
72
73 return textStream.str();
74}
75
76// Returns the text contents of the given file
77inline std::string loadFileToString(const fs::path& path)

Callers 6

TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 3

openTextFileMethod · 0.45
flushMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected