MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / ReadFileAsString

Function ReadFileAsString

SampleFramework12/v1.00/FileIO.cpp:117–127  ·  view source on GitHub ↗

Returns the contents of a file as a string

Source from the content-addressed store, hash-verified

115
116// Returns the contents of a file as a string
117std::string ReadFileAsString(const wchar* filePath)
118{
119 File file(filePath, FileOpenMode::Read);
120 uint64 fileSize = file.Size();
121
122 std::string fileContents;
123 fileContents.resize(size_t(fileSize), 0);
124 file.Read(fileSize, &fileContents[0]);
125
126 return fileContents;
127}
128
129// Writes the contents of a string to a file
130void WriteStringAsFile(const wchar* filePath, const std::string& data)

Callers 1

GetExpandedShaderCodeFunction · 0.85

Calls 3

resizeMethod · 0.80
SizeMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected