Skip to content

Commit ad49c25

Browse files
committed
Split up util.cpp/h
Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
1 parent f841aa2 commit ad49c25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+875
-734
lines changed

src/Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ BITCOIN_CORE_H = \
109109
ui_interface.h \
110110
uint256.h \
111111
util.h \
112+
utilstrencodings.h \
113+
utilmoneystr.h \
114+
utiltime.h \
112115
version.h \
113116
walletdb.h \
114117
wallet.h \
@@ -219,6 +222,9 @@ libbitcoin_util_a_SOURCES = \
219222
sync.cpp \
220223
uint256.cpp \
221224
util.cpp \
225+
utilstrencodings.cpp \
226+
utilmoneystr.cpp \
227+
utiltime.cpp \
222228
version.cpp \
223229
$(BITCOIN_CORE_H)
224230

src/alert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <boost/algorithm/string/classification.hpp>
2020
#include <boost/algorithm/string/replace.hpp>
2121
#include <boost/foreach.hpp>
22+
#include <boost/thread.hpp>
2223

2324
using namespace std;
2425

src/bitcoin-cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "rpcclient.h"
99
#include "rpcprotocol.h"
1010
#include "chainparamsbase.h"
11+
#include "utilstrencodings.h"
1112
#include "version.h"
1213

1314
#include <boost/filesystem/operations.hpp>

src/bitcoin-tx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "base58.h"
66
#include "util.h"
7+
#include "utilmoneystr.h"
78
#include "core.h"
89
#include "main.h" // for MAX_BLOCK_SIZE
910
#include "keystore.h"

src/bitcoind.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <boost/algorithm/string/predicate.hpp>
1414
#include <boost/filesystem.hpp>
15+
#include <boost/thread.hpp>
1516

1617
/* Introduction text for doxygen: */
1718

src/core_write.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "core.h"
99
#include "serialize.h"
1010
#include "util.h"
11+
#include "utilmoneystr.h"
1112
#include "base58.h"
1213

1314
using namespace std;

src/crypter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "crypter.h"
66

77
#include "script.h"
8+
#include "util.h"
89

910
#include <string>
1011
#include <vector>

src/db.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "hash.h"
1010
#include "protocol.h"
1111
#include "util.h"
12+
#include "utilstrencodings.h"
1213

1314
#include <stdint.h>
1415

@@ -17,6 +18,7 @@
1718
#endif
1819

1920
#include <boost/filesystem.hpp>
21+
#include <boost/thread.hpp>
2022
#include <boost/version.hpp>
2123
#include <openssl/rand.h>
2224

src/init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "txdb.h"
2020
#include "ui_interface.h"
2121
#include "util.h"
22+
#include "utilmoneystr.h"
2223
#ifdef ENABLE_WALLET
2324
#include "db.h"
2425
#include "wallet.h"
@@ -36,6 +37,7 @@
3637
#include <boost/algorithm/string/predicate.hpp>
3738
#include <boost/filesystem.hpp>
3839
#include <boost/interprocess/sync/file_lock.hpp>
40+
#include <boost/thread.hpp>
3941
#include <openssl/crypto.h>
4042

4143
using namespace boost;

src/keystore.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "crypter.h"
99
#include "key.h"
1010
#include "script.h"
11+
#include "util.h"
1112

1213
#include <boost/foreach.hpp>
1314

0 commit comments

Comments
 (0)