Joedb 9.5.0
The Journal-Only Embedded Database
|
#include <joedb/journal/Abstract_File.h>
Public Member Functions | |
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. | |
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 and meta-data (such as file size) durably to permanent storage. | |
virtual void | datasync () |
Write data durably to permanent storage. | |
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. | |
virtual | ~Abstract_File ()=default |
Definition at line 10 of file Abstract_File.h.
|
virtualdefault |
|
inlinevirtual |
Definition at line 29 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 35 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Server_File, joedb::Encoded_File, joedb::File_View, joedb::Memory_File, joedb::Posix_FD, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 14 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::File_View, joedb::SFTP_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 20 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Encoded_File, joedb::Memory_File, joedb::Posix_FD, joedb::Server_File, joedb::Stream_File, and joedb::Windows_Handle.
Definition at line 23 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 32 of file Abstract_File.h.
|
inlinevirtual |
Reimplemented in joedb::Encoded_File, joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 26 of file Abstract_File.h.
|
inlinevirtualnoexcept |
Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.
Definition at line 38 of file Abstract_File.h.