| 2987 | } |
| 2988 | |
| 2989 | void writeFileBytes(std::string const& filename, const uint8_t* data, size_t count) { |
| 2990 | std::ofstream ofs(filename, std::fstream::out | std::fstream::binary); |
| 2991 | if (!ofs.good()) { |
| 2992 | TraceEvent("WriteFileBytes_FileOpenError").detail("Filename", filename).GetLastError(); |
| 2993 | throw io_error(); |
| 2994 | } |
| 2995 | |
| 2996 | ofs.write((const char*)data, count); |
| 2997 | } |
| 2998 | |
| 2999 | void writeFile(std::string const& filename, std::string const& content) { |
| 3000 | writeFileBytes(filename, (const uint8_t*)(content.c_str()), content.size()); |
no test coverage detected