Add clang-format (#1086)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Bart Louwers
2023-05-01 16:57:37 +02:00
committed by GitHub
parent 403a12bd1b
commit 71f6da2722
1018 changed files with 27876 additions and 25862 deletions

View File

@@ -16,9 +16,9 @@
namespace mbgl {
namespace util {
IOException::IOException(int err, const std::string& msg)
: std::runtime_error(msg + ": " + std::strerror(errno)), code(err) {
}
IOException::IOException(int err, const std::string &msg)
: std::runtime_error(msg + ": " + std::strerror(errno)),
code(err) {}
void write_file(const std::string &filename, const std::string &data) {
FILE *fd = fopen(filename.c_str(), MBGL_FOPEN_MODE_WBE);
@@ -51,14 +51,14 @@ std::optional<std::string> readFile(const std::string &filename) {
return {};
}
void deleteFile(const std::string& filename) {
void deleteFile(const std::string &filename) {
const int ret = std::remove(filename.c_str());
if (ret != 0 && errno != ENOENT) {
throw IOException(errno, "Could not delete file " + filename);
}
}
void copyFile(const std::string& destination, const std::string& source) {
void copyFile(const std::string &destination, const std::string &source) {
std::ifstream src(source, std::ios::binary);
if (!src.good()) {
throw IOException(errno, "Cannot read file " + source);