MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / LoadFileToString

Function LoadFileToString

core/platform.cpp:222–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222string LoadFileToString(const char* filename)
223{
224 //std::ifstream file(filename);
225 //return string((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
226 uint32_t size;
227 uint8_t* buf = LoadFileToBuffer(filename, &size);
228
229 if (buf)
230 {
231 string s(buf, buf+size);
232 delete[] buf;
233
234 return s;
235 }
236 else
237 {
238 return "";
239 }
240}
241
242bool SaveStringToFile(const char* filename, const char* s)
243{

Callers

nothing calls this directly

Calls 1

LoadFileToBufferFunction · 0.85

Tested by

no test coverage detected