#include <joedb/journal/Abstract_File.h>
|
| | 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.
|
| |
| 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) 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 |
| |
Definition at line 14 of file Abstract_File.h.
◆ Abstract_File()
| joedb::Abstract_File::Abstract_File |
( |
Open_Mode |
mode | ) |
|
|
inline |
◆ ~Abstract_File()
| virtual joedb::Abstract_File::~Abstract_File |
( |
| ) |
|
|
virtualdefault |
◆ copy_to() [1/2]
| void joedb::Abstract_File::copy_to |
( |
Abstract_File & |
destination | ) |
const |
|
inline |
◆ copy_to() [2/2]
| void joedb::Abstract_File::copy_to |
( |
Abstract_File & |
destination, |
|
|
int64_t |
start, |
|
|
int64_t |
size |
|
) |
| const |
|
virtual |
◆ datasync()
| virtual void joedb::Abstract_File::datasync |
( |
| ) |
|
|
inlinevirtual |
◆ equal_to()
| bool joedb::Abstract_File::equal_to |
( |
const Abstract_File & |
destination, |
|
|
int64_t |
from, |
|
|
int64_t |
until |
|
) |
| const |
|
virtual |
◆ exclusive_lock()
| virtual void joedb::Abstract_File::exclusive_lock |
( |
int64_t |
start, |
|
|
int64_t |
size |
|
) |
| |
|
inlinevirtual |
◆ exclusive_lock_head()
| void joedb::Abstract_File::exclusive_lock_head |
( |
| ) |
|
|
inline |
◆ exclusive_lock_tail()
| void joedb::Abstract_File::exclusive_lock_tail |
( |
| ) |
|
|
inline |
◆ get_mode()
| Open_Mode joedb::Abstract_File::get_mode |
( |
| ) |
const |
|
inlinenoexcept |
◆ get_size()
| virtual int64_t joedb::Abstract_File::get_size |
( |
| ) |
const |
|
inlinevirtual |
◆ is_readonly()
| bool joedb::Abstract_File::is_readonly |
( |
| ) |
const |
|
inlinenoexcept |
◆ is_shared()
| bool joedb::Abstract_File::is_shared |
( |
| ) |
const |
|
inlinenoexcept |
◆ make_readonly()
| void joedb::Abstract_File::make_readonly |
( |
| ) |
|
|
inlineprotected |
◆ make_writable()
| void joedb::Abstract_File::make_writable |
( |
| ) |
|
|
inlineprotected |
◆ pread()
| virtual size_t joedb::Abstract_File::pread |
( |
char * |
data, |
|
|
size_t |
size, |
|
|
int64_t |
offset |
|
) |
| const |
|
inlinevirtual |
For very large reads, the returned value may be less than size, even if the end of the file is not reached. It is assumed that small reads (such as the 41 bytes of the joedb header) will not be truncated. 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 54 of file Abstract_File.h.
◆ pwrite()
| virtual void joedb::Abstract_File::pwrite |
( |
const char * |
data, |
|
|
size_t |
size, |
|
|
int64_t |
offset |
|
) |
| |
|
inlinevirtual |
◆ read_blob()
| std::string joedb::Abstract_File::read_blob |
( |
Blob |
blob | ) |
const |
◆ reading_past_end_of_file()
| void joedb::Abstract_File::reading_past_end_of_file |
( |
| ) |
|
|
static |
◆ shared_lock()
| virtual void joedb::Abstract_File::shared_lock |
( |
int64_t |
start, |
|
|
int64_t |
size |
|
) |
| |
|
inlinevirtual |
◆ shared_lock_head()
| void joedb::Abstract_File::shared_lock_head |
( |
| ) |
|
|
inline |
◆ sync()
| virtual void joedb::Abstract_File::sync |
( |
| ) |
|
|
inlinevirtual |
◆ unlock()
| virtual void joedb::Abstract_File::unlock |
( |
int64_t |
start, |
|
|
int64_t |
size |
|
) |
| |
|
inlinevirtualnoexcept |
◆ unlock_head()
| void joedb::Abstract_File::unlock_head |
( |
| ) |
|
|
inlinenoexcept |
◆ unlock_tail()
| void joedb::Abstract_File::unlock_tail |
( |
| ) |
|
|
inlinenoexcept |
◆ last_position
| constexpr int64_t joedb::Abstract_File::last_position = (1ULL << 63) - 1 |
|
staticconstexprprotected |
The documentation for this class was generated from the following files: