Returns the contents of a file as a string
| 142 | |
| 143 | // Returns the contents of a file as a string |
| 144 | std::string ReadFileAsString(const wchar* filePath) |
| 145 | { |
| 146 | File file(filePath, FileOpenMode::Read); |
| 147 | uint64 fileSize = file.Size(); |
| 148 | |
| 149 | std::string fileContents; |
| 150 | fileContents.resize(size_t(fileSize), 0); |
| 151 | file.Read(fileSize, &fileContents[0]); |
| 152 | |
| 153 | return fileContents; |
| 154 | } |
| 155 | |
| 156 | // Writes the contents of a string to a file |
| 157 | void WriteStringAsFile(const wchar* filePath, const std::string& data) |
no test coverage detected