1 #pragma once 2 3 #include <mbgl/util/optional.hpp> 4 5 #include <string> 6 #include <stdexcept> 7 8 namespace mbgl { 9 namespace util { 10 11 struct IOException : std::runtime_error { 12 IOException(int err, const std::string& msg); 13 const int code = 0; 14 }; 15 16 void write_file(const std::string &filename, const std::string &data); 17 std::string read_file(const std::string &filename); 18 19 optional<std::string> readFile(const std::string &filename); 20 void deleteFile(const std::string& filename); 21 void copyFile(const std::string& destination, const std::string& source); 22 23 } // namespace util 24 } // namespace mbgl 25