11 #if defined WIN32 && defined __GLIBCXX__
12 #include <ext/stdio_filebuf.h>
15 #define BOOST_FILESYSTEM_NO_DEPRECATED
16 #include <boost/filesystem.hpp>
17 #include <boost/filesystem/fstream.hpp>
20 namespace fs = boost::filesystem;
24 FILE *
fopen(
const fs::path& p,
const char *mode);
32 explicit FileLock(
const fs::path& file);
42 void* hFile = (
void*)-1;
62 #if defined WIN32 && defined __GLIBCXX__
67 explicit ifstream(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::in) { open(p, mode); }
69 void open(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::in);
70 bool is_open() {
return m_filebuf.is_open(); }
74 __gnu_cxx::stdio_filebuf<char> m_filebuf;
75 FILE* m_file =
nullptr;
81 explicit ofstream(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::out) { open(p, mode); }
83 void open(
const fs::path& p, std::ios_base::openmode mode = std::ios_base::out);
84 bool is_open() {
return m_filebuf.is_open(); }
88 __gnu_cxx::stdio_filebuf<char> m_filebuf;
89 FILE* m_file =
nullptr;
FileLock(FileLock &&)=delete
FileLock(const FileLock &)=delete
Filesystem operations and types.
FILE * fopen(const fs::path &p, const char *mode)
std::string get_filesystem_error_message(const fs::filesystem_error &e)