Wrapper around a sort key buffer.
More...
|
| Wrapper_sort_key (uchar *buf, size_t len) |
|
size_t | remaining () const |
| Get the remaining space in the buffer. More...
|
|
size_t | pos () const |
| Get how much space we've used so far. More...
|
|
void | append (uchar ch) |
| Append a character to the buffer. More...
|
|
void | pad_till (uchar pad_character, size_t pos) |
| Pad the buffer with the specified character till given position. More...
|
|
void | copy_int (size_t target_length, const uchar *from, size_t from_length, bool is_unsigned) |
| Copy an integer to the buffer and format it in a way that makes it possible to sort the integers with memcpy(). More...
|
|
void | append_str_and_len (const char *str, size_t len) |
| Append a string to the buffer, and add the length of the string to the end of the buffer. More...
|
|
Wrapper around a sort key buffer.
◆ Wrapper_sort_key()
anonymous_namespace{json_dom.cc}::Wrapper_sort_key::Wrapper_sort_key |
( |
uchar * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inline |
◆ append()
void anonymous_namespace{json_dom.cc}::Wrapper_sort_key::append |
( |
uchar |
ch | ) |
|
|
inline |
Append a character to the buffer.
◆ append_str_and_len()
void anonymous_namespace{json_dom.cc}::Wrapper_sort_key::append_str_and_len |
( |
const char * |
str, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Append a string to the buffer, and add the length of the string to the end of the buffer.
The space between the end of the string and the beginning of the length field is padded with zeros.
◆ copy_int()
void anonymous_namespace{json_dom.cc}::Wrapper_sort_key::copy_int |
( |
size_t |
target_length, |
|
|
const uchar * |
from, |
|
|
size_t |
from_length, |
|
|
bool |
is_unsigned |
|
) |
| |
|
inline |
Copy an integer to the buffer and format it in a way that makes it possible to sort the integers with memcpy().
- Parameters
-
target_length | the number of bytes to write to the buffer |
from | the buffer to copy the integer from (in little-endian format) |
from_length | the size of the from buffer |
is_unsigned | true if the from buffer contains an unsigned integer, false otherwise |
◆ pad_till()
void anonymous_namespace{json_dom.cc}::Wrapper_sort_key::pad_till |
( |
uchar |
pad_character, |
|
|
size_t |
pos |
|
) |
| |
|
inline |
Pad the buffer with the specified character till given position.
- Note
- This function is intended to be used to make numbers of equal length without occupying the whole buffer.
◆ pos()
size_t anonymous_namespace{json_dom.cc}::Wrapper_sort_key::pos |
( |
| ) |
const |
|
inline |
Get how much space we've used so far.
◆ remaining()
size_t anonymous_namespace{json_dom.cc}::Wrapper_sort_key::remaining |
( |
| ) |
const |
|
inline |
Get the remaining space in the buffer.
◆ m_buffer
uchar* anonymous_namespace{json_dom.cc}::Wrapper_sort_key::m_buffer |
|
private |
the buffer into which to write
◆ m_length
size_t anonymous_namespace{json_dom.cc}::Wrapper_sort_key::m_length |
|
private |
◆ m_pos
size_t anonymous_namespace{json_dom.cc}::Wrapper_sort_key::m_pos |
|
private |
the current position in the buffer
The documentation for this class was generated from the following file: