refactor: replace boost::filesystem with std::filesystem
Warning: Replacing fs::system_complete calls with fs::absolute calls in this commit may cause minor changes in behaviour because fs::absolute no longer strips trailing slashes; however these changes are believed to be safe. Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
37 files changed
+195
-287
No files matched your search
+8
-3
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <base58.h>
|
||||
#include <chainparams.h>
|
||||
#include <fs.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <key_io.h>
|
||||
#include <policy/policy.h>
|
||||
@@ -66,6 +67,10 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
|
||||
@@ -426,7 +431,7 @@ bool openBitcoinConf()
|
||||
fs::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
|
||||
/* Create the file */
|
||||
fsbridge::ofstream configFile(pathConfig, std::ios_base::app);
|
||||
std::ofstream configFile{pathConfig, std::ios_base::app};
|
||||
|
||||
if (!configFile.good())
|
||||
return false;
|
||||
@@ -586,7 +591,7 @@ fs::path static GetAutostartFilePath()
|
||||
|
||||
bool GetStartOnSystemStartup()
|
||||
{
|
||||
fsbridge::ifstream optionFile(GetAutostartFilePath());
|
||||
std::ifstream optionFile{GetAutostartFilePath()};
|
||||
if (!optionFile.good())
|
||||
return false;
|
||||
// Scan through file for "Hidden=true":
|
||||
@@ -617,7 +622,7 @@ bool SetStartOnSystemStartup(bool fAutoStart)
|
||||
|
||||
fs::create_directories(GetAutostartDir());
|
||||
|
||||
fsbridge::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out | std::ios_base::trunc);
|
||||
std::ofstream optionFile{GetAutostartFilePath(), std::ios_base::out | std::ios_base::trunc};
|
||||
if (!optionFile.good())
|
||||
return false;
|
||||
std::string chain = gArgs.GetChainName();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <qt/psbtoperationsdialog.h>
|
||||
|
||||
#include <core_io.h>
|
||||
#include <fs.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <key_io.h>
|
||||
#include <node/psbt.h>
|
||||
@@ -15,7 +16,9 @@
|
||||
#include <qt/optionsmodel.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using node::AnalyzePSBT;
|
||||
using node::DEFAULT_MAX_RAW_TX_FEE_RATE;
|
||||
@@ -158,7 +161,7 @@ void PSBTOperationsDialog::saveTransaction() {
|
||||
if (filename.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
fsbridge::ofstream out{filename.toLocal8Bit().data(), fsbridge::ofstream::out | fsbridge::ofstream::binary};
|
||||
std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary};
|
||||
out << ssTx.str();
|
||||
out.close();
|
||||
showStatus(tr("PSBT saved to disk."), StatusLevel::INFO);
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
#include <wallet/fees.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QScrollBar>
|
||||
@@ -509,7 +512,7 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
|
||||
if (filename.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
fsbridge::ofstream out{filename.toLocal8Bit().data(), fsbridge::ofstream::out | fsbridge::ofstream::binary};
|
||||
std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary};
|
||||
out << ssTx.str();
|
||||
out.close();
|
||||
Q_EMIT message(tr("PSBT saved"), "PSBT saved to disk", CClientUIInterface::MSG_INFORMATION);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <qt/walletframe.h>
|
||||
|
||||
#include <fs.h>
|
||||
#include <node/ui_interface.h>
|
||||
#include <psbt.h>
|
||||
#include <qt/guiutil.h>
|
||||
@@ -14,6 +15,8 @@
|
||||
#include <util/system.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
@@ -210,7 +213,7 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)
|
||||
Q_EMIT message(tr("Error"), tr("PSBT file must be smaller than 100 MiB"), CClientUIInterface::MSG_ERROR);
|
||||
return;
|
||||
}
|
||||
fsbridge::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
|
||||
std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
|
||||
data = std::string(std::istreambuf_iterator<char>{in}, {});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user