MySQL 9.1.0
Source Code Documentation
anonymous_namespace{json_dom.cc}::Wrapper_sort_key Class Reference

Wrapper around a sort key buffer. More...

Public Member Functions

 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...
 

Private Attributes

ucharm_buffer
 the buffer into which to write More...
 
size_t m_length
 the length of the buffer More...
 
size_t m_pos
 the current position in the buffer More...
 

Detailed Description

Wrapper around a sort key buffer.

Constructor & Destructor Documentation

◆ Wrapper_sort_key()

anonymous_namespace{json_dom.cc}::Wrapper_sort_key::Wrapper_sort_key ( uchar buf,
size_t  len 
)
inline

Member Function Documentation

◆ 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_lengththe number of bytes to write to the buffer
fromthe buffer to copy the integer from (in little-endian format)
from_lengththe size of the from buffer
is_unsignedtrue 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.

Member Data Documentation

◆ 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

the length of the buffer

◆ 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: