Files
fan/src/utils.cpp
2026-09-27 01:33:35 +02:00

21 lines
327 B
C++

#include <fstream>
#include <sstream>
#include "utils.hpp"
namespace Fan
{
Opt<std::string> read_entire_file(const std::string& file_path)
{
std::ifstream file(file_path);
if (!file) { return std::nullopt; }
std::ostringstream buffer;
buffer << file.rdbuf();
return buffer.str();
}
} // namespace Fan