|
Joedb 10.5.0
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=std::numeric_limits< int64_t >::max()) 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 15 of file Abstract_File.h.
|
inline |
Definition at line 26 of file Abstract_File.h.
|
virtualdefault |
|
inline |
Definition at line 105 of file Abstract_File.h.
|
virtual |
Definition at line 39 of file Abstract_File.cpp.
|
inlinevirtual |
Definition at line 65 of file Abstract_File.h.
|
virtual |
Definition at line 72 of file Abstract_File.cpp.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_File, and joedb::Windows_Handle.
Definition at line 71 of file Abstract_File.h.
|
inline |
Definition at line 79 of file Abstract_File.h.
|
inline |
Definition at line 76 of file Abstract_File.h.
| void joedb::Abstract_File::full_pread | ( | char * | data, |
| size_t | size, | ||
| int64_t | offset ) const |
Definition at line 12 of file Abstract_File.cpp.
|
inlinenoexcept |
Definition at line 41 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Encoded_File, joedb::Memory_File, joedb::Posix_File, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Server_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 47 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 36 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 31 of file Abstract_File.h.
|
inlineprotected |
Definition at line 21 of file Abstract_File.h.
|
inlineprotected |
Definition at line 22 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::Abstract_Interpreted_File, joedb::Encoded_File, joedb::Memory_File, joedb::Posix_File, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Server_File, joedb::SFTP_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 53 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Encoded_File, joedb::Memory_File, joedb::Posix_File, joedb::Server_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 59 of file Abstract_File.h.
| std::string joedb::Abstract_File::read_blob | ( | Blob | blob, |
| int64_t | max_size = std::numeric_limits<int64_t>::max() ) const |
Definition at line 139 of file Abstract_File.cpp.
|
static |
Definition at line 132 of file Abstract_File.cpp.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_File, and joedb::Windows_Handle.
Definition at line 68 of file Abstract_File.h.
|
inline |
Definition at line 80 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Encoded_File, joedb::Posix_File, and joedb::Windows_Handle.
Definition at line 62 of file Abstract_File.h.
|
inlinevirtualnoexcept |
Reimplemented in joedb::Abstract_Interpreted_File, joedb::Posix_File, and joedb::Windows_Handle.
Definition at line 74 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 81 of file Abstract_File.h.
|
inlinenoexcept |
Definition at line 77 of file Abstract_File.h.
|
staticconstexprprotected |
Definition at line 23 of file Abstract_File.h.