|
Joedb 10.4.3
The Journal-Only Embedded Database
|
#include <joedb/journal/Abstract_File.h>

Public Member Functions | |
| Abstract_File (Open_Mode mode) | |
| bool | is_shared () const noexcept |
| bool | is_readonly () const noexcept |
| Open_Mode | get_mode () const noexcept |
| 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. | |
| void | full_pread (char *data, size_t size, int64_t offset) const |
| Fill the buffer, or throw if the end of the file is reached. | |
| virtual void | pwrite (const char *data, size_t size, int64_t offset) |
| Write a range of bytes. Extend file size if necessary. | |
| virtual void | sync () |
| Write data durably (including file-size change) | |
| virtual void | datasync () |
| Write data durably (no file-size change) | |
| virtual void | shared_lock (int64_t start, int64_t size) |
| Lock a range of bytes for reading (prevents writes, not reads) | |
| virtual void | exclusive_lock (int64_t start, int64_t size) |
| Lock a range of bytes for writing (prevents both writes and reads) | |
| virtual void | unlock (int64_t start, int64_t size) noexcept |
| Remove a lock. The range should match the range of a corresponding lock. | |
| void | exclusive_lock_tail () |
| void | unlock_tail () noexcept |
| void | exclusive_lock_head () |
| void | shared_lock_head () |
| void | unlock_head () noexcept |
| std::string | read_blob (Blob blob, int64_t max_size=-1) const |
| virtual void | copy_to (Abstract_File &destination, int64_t start, int64_t size) const |
| virtual bool | equal_to (const Abstract_File &destination, int64_t from, int64_t until) const |
| void | copy_to (Abstract_File &destination) const |
| virtual | ~Abstract_File ()=default |
Static Public Member Functions | |
| static void | reading_past_end_of_file () |
Protected Member Functions | |
| void | make_readonly () |
| void | make_writable () |
Static Protected Attributes | |
| static constexpr int64_t | last_position = (1ULL << 63) - 1 |
Definition at line 14 of file Abstract_File.h.
|
inline |
Definition at line 25 of file Abstract_File.h.
|
virtualdefault |
|
inline |
Definition at line 100 of file Abstract_File.h.
|
virtual |
Definition at line 40 of file Abstract_File.cpp.
|
inlinevirtual |
Definition at line 64 of file Abstract_File.h.
|
virtual |
Definition at line 73 of file Abstract_File.cpp.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 70 of file Abstract_File.h.
|
inline |
Definition at line 78 of file Abstract_File.h.
|
inline |
Definition at line 75 of file Abstract_File.h.
| void joedb::Abstract_File::full_pread | ( | char * | data, |
| size_t | size, | ||
| int64_t | offset | ||
| ) | const |
Definition at line 13 of file Abstract_File.cpp.
|
inlinenoexcept |
Definition at line 40 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Server_File, joedb::Encoded_File, joedb::Abstract_Interpreted_File, joedb::Memory_File, joedb::Posix_FD, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 46 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 35 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 30 of file Abstract_File.h.
|
inlineprotected |
Definition at line 20 of file Abstract_File.h.
|
inlineprotected |
Definition at line 21 of file Abstract_File.h.
|
inlinevirtual |
The returned value may be less than size, even if the end of the file is not reached. 0 is returned if the end of the file is reached.
Reimplemented in joedb::Encoded_File, joedb::Memory_File, joedb::Posix_FD, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Server_File, joedb::Abstract_Interpreted_File, joedb::SFTP_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 52 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Encoded_File, joedb::Abstract_Interpreted_File, joedb::Memory_File, joedb::Posix_FD, joedb::Server_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 58 of file Abstract_File.h.
| std::string joedb::Abstract_File::read_blob | ( | Blob | blob, |
| int64_t | max_size = -1 |
||
| ) | const |
Definition at line 140 of file Abstract_File.cpp.
|
static |
Definition at line 133 of file Abstract_File.cpp.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 67 of file Abstract_File.h.
|
inline |
Definition at line 79 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Encoded_File, joedb::Abstract_Interpreted_File, joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 61 of file Abstract_File.h.
|
inlinevirtualnoexcept |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 73 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 80 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 76 of file Abstract_File.h.
|
staticconstexprprotected |
Definition at line 22 of file Abstract_File.h.