| 57 | } |
| 58 | |
| 59 | std::string read_text_file(const std::filesystem::path & path) { |
| 60 | std::ifstream input(path, std::ios::binary); |
| 61 | if (!input) { |
| 62 | throw std::runtime_error("failed to open text file: " + path.string()); |
| 63 | } |
| 64 | std::ostringstream buffer; |
| 65 | buffer << input.rdbuf(); |
| 66 | return buffer.str(); |
| 67 | } |
| 68 | |
| 69 | } // namespace engine::io |
no test coverage detected