Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Portable_File.h
Go to the documentation of this file.
1#ifndef joedb_Portable_File_declared
2#define joedb_Portable_File_declared
3
5
6#include <fstream> // IWYU pragma: keep
7
8namespace joedb
9{
10 namespace detail
11 {
12 class Portable_File_Buffer
13 {
14 protected:
15 std::filebuf filebuf;
16
17 public:
18 Portable_File_Buffer(const char *file_name, Open_Mode mode);
19 };
20 }
21
22 /// @ingroup journal
23 class Portable_File: private detail::Portable_File_Buffer, public Stream_File
24 {
25 public:
26 Portable_File(const char *file_name, Open_Mode mode):
27 detail::Portable_File_Buffer(file_name, mode),
28 Stream_File(filebuf, mode)
29 {
30 }
31
32 Portable_File(const std::string &file_name, Open_Mode mode):
33 Portable_File(file_name.c_str(), mode)
34 {
35 }
36 };
37}
38
39#endif
Portable_File(const std::string &file_name, Open_Mode mode)
Portable_File(const char *file_name, Open_Mode mode)
Open_Mode
Definition Open_Mode.h:8
Definition Blob.h:7