Returns the contents of a file as a string
| 109 | |
| 110 | // Returns the contents of a file as a string |
| 111 | std::string ReadFileAsString(const wchar* filePath) |
| 112 | { |
| 113 | File file(filePath, File::OpenRead); |
| 114 | uint64 fileSize = file.Size(); |
| 115 | |
| 116 | std::string fileContents; |
| 117 | fileContents.resize(size_t(fileSize), 0); |
| 118 | file.Read(fileSize, &fileContents[0]); |
| 119 | |
| 120 | return fileContents; |
| 121 | } |
| 122 | |
| 123 | // Writes the contents of a string to a file |
| 124 | void WriteStringAsFile(const wchar* filePath, const std::string& data) |
no test coverage detected