| 5 | #include <stdexcept> |
| 6 | |
| 7 | std::string getFileContents(const std::string &filePath) |
| 8 | { |
| 9 | std::ifstream inFile(filePath); |
| 10 | if (!inFile.is_open()) { |
| 11 | throw std::runtime_error("Unable to open file: " + filePath); |
| 12 | } |
| 13 | |
| 14 | std::stringstream stream; |
| 15 | |
| 16 | stream << inFile.rdbuf(); |
| 17 | return stream.str(); |
| 18 | } |