| 48 | |
| 49 | namespace visage { |
| 50 | bool replaceFileWithData(const File& file, const unsigned char* data, size_t size) { |
| 51 | std::ofstream stream(file, std::ios::binary); |
| 52 | if (!stream) |
| 53 | return false; |
| 54 | |
| 55 | stream.write(reinterpret_cast<const char*>(data), size); |
| 56 | |
| 57 | if (stream.fail()) |
| 58 | return false; |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | bool replaceFileWithText(const File& file, const std::string& text) { |
| 64 | std::ofstream stream(file, std::ios::binary); |
no outgoing calls
no test coverage detected