Joedb 10.2.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Blob.h
Go to the documentation of this file.
1#ifndef joedb_Blob_declared
2#define joedb_Blob_declared
3
4#include <stdint.h>
5
6namespace joedb
7{
8 /// @ingroup joedb
9 class Blob
10 {
11 private:
12 int64_t position;
13 int64_t size;
14
15 public:
16 explicit Blob(int64_t position, int64_t size) noexcept:
17 position(position),
18 size(size)
19 {
20 }
21
22 Blob() noexcept: Blob(0, 0)
23 {
24 }
25
26 bool is_null() const noexcept {return position == 0 && size == 0;}
27 bool operator<(Blob blob) const noexcept {return position < blob.position;}
28
29 int64_t get_position() const noexcept {return position;}
30 int64_t get_size() const noexcept {return size;}
31 int64_t get_end() const noexcept {return position + size;}
32 };
33}
34
35#endif
int64_t get_position() const noexcept
Definition Blob.h:29
int64_t get_end() const noexcept
Definition Blob.h:31
bool operator<(Blob blob) const noexcept
Definition Blob.h:27
bool is_null() const noexcept
Definition Blob.h:26
int64_t get_size() const noexcept
Definition Blob.h:30
Blob(int64_t position, int64_t size) noexcept
Definition Blob.h:16
Blob() noexcept
Definition Blob.h:22