summaryrefslogtreecommitdiff
path: root/src/mbgl/util/io.hpp
blob: e628e82124e27d5c4cfb83436b0fb17d53a35fd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include <mbgl/util/optional.hpp>

#include <string>
#include <stdexcept>

namespace mbgl {
namespace util {

struct IOException : std::runtime_error {
    IOException(int err, const std::string& msg);
    const int code = 0;
};

void write_file(const std::string &filename, const std::string &data);
std::string read_file(const std::string &filename);

optional<std::string> readFile(const std::string &filename);
void deleteFile(const std::string& filename);
void copyFile(const std::string& destination, const std::string& source);

} // namespace util
} // namespace mbgl