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

Function loadFileToString

test/algorithm/FileUtils.h:77–85  ·  view source on GitHub ↗

Returns the text contents of the given file

Source from the content-addressed store, hash-verified

75
76// Returns the text contents of the given file
77inline std::string loadFileToString(const fs::path& path)
78{
79 std::stringstream contentStream;
80 std::ifstream input(path);
81
82 contentStream << input.rdbuf();
83
84 return contentStream.str();
85}
86
87// True if the file (full physical path) contains the given text (ignoring CRLF vs. LF line break differences)
88inline bool fileContainsText(const fs::path& path, const std::string& textToFind)

Callers 9

TEST_FFunction · 0.85
replacePropertiesBlockFunction · 0.85
loadSettingsFileFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
assertFileIsMapxFileFunction · 0.85
fileContainsTextFunction · 0.85

Calls 1

strMethod · 0.45

Tested by

no test coverage detected