| 85 | // ---- get_binary_file_contents ----------------------------------------------- |
| 86 | |
| 87 | std::vector<char> get_binary_file_contents(const char* filename) { |
| 88 | std::ifstream in(filename, std::ios::in | std::ios::binary); |
| 89 | if (in) { |
| 90 | std::vector<char> contents; |
| 91 | in.seekg(0, std::ios::end); |
| 92 | contents.resize((unsigned int)in.tellg()); |
| 93 | in.seekg(0, std::ios::beg); |
| 94 | in.read(&contents[0], contents.size()); |
| 95 | in.close(); |
| 96 | return (contents); |
| 97 | } |
| 98 | throw(errno); |
| 99 | } |
| 100 | |
| 101 | // ---- write_bytes_atomic ----------------------------------------------------- |
| 102 | // |
no test coverage detected