1 #ifndef IOUTILITIES_NATIVE_FILE_STREAM 2 #define IOUTILITIES_NATIVE_FILE_STREAM 6 #if defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER) 7 #if defined(PLATFORM_MINGW) || defined(PLATFORM_LINUX) 8 #include <ext/stdio_filebuf.h> 13 #error "Platform not supported by NativeFileStream." 22 #if defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER) && (defined(PLATFORM_MINGW) || defined(PLATFORM_UNIX)) 31 void open(
const std::string &path, std::ios_base::openmode openMode);
32 void openFromFileDescriptor(
int fileDescriptor, std::ios_base::openmode openMode);
34 std::__c_file fileHandle();
37 std::unique_ptr<__gnu_cxx::stdio_filebuf<char>> m_filebuf;
38 std::__c_file m_cfile;
41 inline bool NativeFileStream::is_open()
const 43 return m_filebuf && m_filebuf->is_open();
46 inline std::__c_file NativeFileStream::fileHandle()
59 #endif // IOUTILITIES_NATIVE_FILE_STREAM std::fstream NativeFileStream
Contains utility classes helping to read and write streams.
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.