File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ BITCOIN_CORE_H = \
9898 core_io.h \
9999 core_memusage.h \
100100 cuckoocache.h \
101+ fs.h \
101102 httprpc.h \
102103 httpserver.h \
103104 indirectmap.h \
@@ -326,6 +327,7 @@ libbitcoin_util_a_SOURCES = \
326327 compat/glibc_sanity.cpp \
327328 compat/glibcxx_sanity.cpp \
328329 compat/strnlen.cpp \
330+ fs.cpp \
329331 random.cpp \
330332 rpc/protocol.cpp \
331333 support/cleanse.cpp \
Original file line number Diff line number Diff line change 1+ #include " fs.h"
2+
3+ #include < boost/filesystem.hpp>
4+
5+ namespace fsbridge {
6+
7+ FILE *fopen (const fs::path& p, const char *mode)
8+ {
9+ return ::fopen (p.string ().c_str (), mode);
10+ }
11+
12+ FILE *freopen (const fs::path& p, const char *mode, FILE *stream)
13+ {
14+ return ::freopen (p.string ().c_str (), mode, stream);
15+ }
16+
17+ } // fsbridge
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2017 The Bitcoin Core developers
2+ // Distributed under the MIT software license, see the accompanying
3+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+ #ifndef BITCOIN_FS_H
6+ #define BITCOIN_FS_H
7+
8+ #include < stdio.h>
9+ #include < string>
10+
11+ #include < boost/filesystem.hpp>
12+ #include < boost/filesystem/fstream.hpp>
13+ #include < boost/filesystem/detail/utf8_codecvt_facet.hpp>
14+
15+ /* * Filesystem operations and types */
16+ namespace fs = boost::filesystem;
17+
18+ /* * Bridge operations to C stdio */
19+ namespace fsbridge {
20+ FILE *fopen (const fs::path& p, const char *mode);
21+ FILE *freopen (const fs::path& p, const char *mode, FILE *stream);
22+ };
23+
24+ #endif
You can’t perform that action at this time.
0 commit comments