10 #if defined WIN32 && defined __GLIBCXX__ 11 #include <ext/stdio_filebuf.h> 14 #include <boost/filesystem.hpp> 15 #include <boost/filesystem/fstream.hpp> 18 namespace fs = boost::filesystem;
22 FILE *
fopen(
const fs::path& p,
const char *mode);
33 fs::path
AbsPathJoin(
const fs::path& base,
const fs::path& path);
41 explicit FileLock(
const fs::path& file);
51 void* hFile = (
void*)-1;
71 #if defined WIN32 && defined __GLIBCXX__ 76 explicit ifstream(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::in) { open(p, mode); }
78 void open(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::in);
79 bool is_open() {
return m_filebuf.is_open(); }
83 __gnu_cxx::stdio_filebuf<char> m_filebuf;
84 FILE* m_file =
nullptr;
90 explicit ofstream(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::out) { open(p, mode); }
92 void open(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::out);
93 bool is_open() {
return m_filebuf.is_open(); }
97 __gnu_cxx::stdio_filebuf<char> m_filebuf;
98 FILE* m_file =
nullptr;
100 #else // !(WIN32 && __GLIBCXX__) 103 #endif // WIN32 && __GLIBCXX__ 106 #endif // BITCOIN_FS_H fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
FILE * fopen(const fs::path &p, const char *mode)
Filesystem operations and types.
std::string get_filesystem_error_message(const fs::filesystem_error &e)