Returns the contents of a file as a string
| 115 | |
| 116 | // Returns the contents of a file as a string |
| 117 | std::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 |
| 130 | void WriteStringAsFile(const wchar* filePath, const std::string& data) |
no test coverage detected