Skip to content

Commit 18fb363

Browse files
EmpactTheCharlatan
authored andcommitted
refactor: Extract util/fs_helpers from util/system
This is an extraction of filesystem related functions from util/system into their own utility file. The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager defined in system.h. Moving these functions out of system.h allows including them from a separate source file without including the ArgsManager definitions from system.h.
1 parent 40e1c4d commit 18fb363

22 files changed

+382
-318
lines changed

src/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ BITCOIN_CORE_H = \
285285
util/exception.h \
286286
util/fastrange.h \
287287
util/fees.h \
288+
util/fs_helpers.h \
288289
util/getuniquepath.h \
289290
util/golombrice.h \
290291
util/hash_type.h \
@@ -707,6 +708,7 @@ libbitcoin_util_a_SOURCES = \
707708
util/error.cpp \
708709
util/exception.cpp \
709710
util/fees.cpp \
711+
util/fs_helpers.cpp \
710712
util/getuniquepath.cpp \
711713
util/hasher.cpp \
712714
util/sock.cpp \
@@ -951,6 +953,7 @@ libbitcoinkernel_la_SOURCES = \
951953
uint256.cpp \
952954
util/check.cpp \
953955
util/exception.cpp \
956+
util/fs_helpers.cpp \
954957
util/getuniquepath.cpp \
955958
util/hasher.cpp \
956959
util/moneystr.cpp \

src/addrdb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <streams.h>
2020
#include <tinyformat.h>
2121
#include <univalue.h>
22+
#include <util/fs_helpers.h>
2223
#include <util/settings.h>
2324
#include <util/system.h>
2425
#include <util/translation.h>

src/dbwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <logging.h>
99
#include <random.h>
1010
#include <tinyformat.h>
11+
#include <util/fs_helpers.h>
1112
#include <util/strencodings.h>
12-
#include <util/system.h>
1313

1414
#include <algorithm>
1515
#include <cassert>

src/flatfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <flatfile.h>
99
#include <logging.h>
1010
#include <tinyformat.h>
11-
#include <util/system.h>
11+
#include <util/fs_helpers.h>
1212

1313
FlatFileSeq::FlatFileSeq(fs::path dir, const char* prefix, size_t chunk_size) :
1414
m_dir(std::move(dir)),

src/index/blockfilterindex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <hash.h>
99
#include <index/blockfilterindex.h>
1010
#include <node/blockstorage.h>
11+
#include <util/fs_helpers.h>
1112
#include <util/system.h>
1213
#include <validation.h>
1314

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include <txmempool.h>
7171
#include <util/asmap.h>
7272
#include <util/check.h>
73+
#include <util/fs_helpers.h>
7374
#include <util/moneystr.h>
7475
#include <util/strencodings.h>
7576
#include <util/string.h>

src/init/common.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <logging.h>
1212
#include <node/interface_ui.h>
1313
#include <tinyformat.h>
14+
#include <util/fs_helpers.h>
1415
#include <util/string.h>
1516
#include <util/system.h>
1617
#include <util/time.h>

src/kernel/mempool_persist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <sync.h>
1616
#include <txmempool.h>
1717
#include <uint256.h>
18-
#include <util/system.h>
18+
#include <util/fs_helpers.h>
1919
#include <util/time.h>
2020
#include <validation.h>
2121

src/qt/guiutil.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <script/script.h>
2222
#include <script/standard.h>
2323
#include <util/exception.h>
24+
#include <util/fs_helpers.h>
2425
#include <util/system.h>
2526
#include <util/time.h>
2627

src/qt/intro.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <qt/optionsmodel.h>
1717

1818
#include <interfaces/node.h>
19+
#include <util/fs_helpers.h>
1920
#include <util/system.h>
2021
#include <validation.h>
2122

0 commit comments

Comments
 (0)