#pragma once #include "StringView.hpp" #include #include namespace dchat { class FileException : public std::runtime_error { public: FileException(const std::string &errMsg) : std::runtime_error(errMsg) {} }; // Throws FileException on error. // Returned value is allocated with `new[]` and should be `delete`[]d by caller. StringView getFileContent(const boost::filesystem::path &filepath); // Throws FileException on error void fileReplace(const boost::filesystem::path &filepath, const StringView data); }