Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
File_View.h
Go to the documentation of this file.
1#ifndef joedb_File_View_declared
2#define joedb_File_View_declared
3
5
6namespace joedb
7{
8 /// @ingroup journal
9 class File_View: public Buffered_File
10 {
11 private:
12 const Abstract_File &file;
13
14 public:
17 file(file)
18 {
19 }
20
21 int64_t get_size() const override
22 {
23 return file.get_size();
24 }
25
26 size_t pread(char *data, size_t size, int64_t offset) const override
27 {
28 return file.pread(data, size, offset);
29 }
30 };
31}
32
33#endif
virtual int64_t get_size() const
Get the size of the file, or -1 if it is unknown.
virtual size_t pread(char *data, size_t size, int64_t offset) const
Read a range of bytes.
File_View(const Abstract_File &file)
Definition File_View.h:15
int64_t get_size() const override
Get the size of the file, or -1 if it is unknown.
Definition File_View.h:21
size_t pread(char *data, size_t size, int64_t offset) const override
Read a range of bytes.
Definition File_View.h:26
Open_Mode
Definition Open_Mode.h:8
@ read_existing
fails if does not exist
Definition Blob.h:7