aboutsummaryrefslogtreecommitdiff
path: root/src/util/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/settings.cpp')
-rw-r--r--src/util/settings.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/util/settings.cpp b/src/util/settings.cpp
index 7fb35c073e..26439b010b 100644
--- a/src/util/settings.cpp
+++ b/src/util/settings.cpp
@@ -1,12 +1,18 @@
-// Copyright (c) 2019 The Bitcoin Core developers
+// Copyright (c) 2019-2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include <fs.h>
#include <util/settings.h>
#include <tinyformat.h>
#include <univalue.h>
+#include <fstream>
+#include <map>
+#include <string>
+#include <vector>
+
namespace util {
namespace {
@@ -63,7 +69,7 @@ bool ReadSettings(const fs::path& path, std::map<std::string, SettingsValue>& va
// Ok for file to not exist
if (!fs::exists(path)) return true;
- fsbridge::ifstream file;
+ std::ifstream file;
file.open(path);
if (!file.is_open()) {
errors.emplace_back(strprintf("%s. Please check permissions.", fs::PathToString(path)));
@@ -106,13 +112,13 @@ bool WriteSettings(const fs::path& path,
for (const auto& value : values) {
out.__pushKV(value.first, value.second);
}
- fsbridge::ofstream file;
+ std::ofstream file;
file.open(path);
if (file.fail()) {
errors.emplace_back(strprintf("Error: Unable to open settings file %s for writing", fs::PathToString(path)));
return false;
}
- file << out.write(/* prettyIndent= */ 1, /* indentLevel= */ 4) << std::endl;
+ file << out.write(/* prettyIndent= */ 4, /* indentLevel= */ 1) << std::endl;
file.close();
return true;
}