MySQL 9.1.0
Source Code Documentation
|
Class to help constructing a Packet
, by pushing values one by one.
More...
#include <packet.h>
Public Member Functions | |
Packet_builder (Packet_t &packet) | |
Construct a new Packet_builder that can be used to store data in the given Packet . More... | |
void | push_int (Type_enum_t type, long long value) |
Append an int field. More... | |
void | push_string_copy (Type_enum_t type, const char *value, std::size_t length, PSI_memory_key key) |
Append a string field, taking a copy of the parameter (raw pointer and length). More... | |
void | push_string_copy (Type_enum_t type, const char *value, PSI_memory_key key) |
Append a string field, taking a copy of the parameter (raw pointer to null-terminated string). More... | |
void | push_string_copy (Type_enum_t type, const std::string &value, PSI_memory_key key) |
Append a string field, taking a copy of the parameter (std::string). More... | |
void | push_string_view (Type_enum_t type, char *value) |
Append a string field, sharing memory with the caller (raw pointer to null-terminated string). More... | |
void | push_string_view (Type_enum_t type, const std::string &value) |
Append a string field, sharing memory with the caller (std::string). More... | |
void | push_bool (Type_enum_t type, bool value) |
Append a boolean field. More... | |
std::size_t | get_position () |
Private Types | |
using | Packet_t = Packet< Type_enum_t > |
Private Attributes | |
Packet_t & | m_packet |
std::size_t | m_position |
Class to help constructing a Packet
, by pushing values one by one.
Type_enum_t | Enumeration for the type codes. |
|
private |
|
inline |
Construct a new Packet_builder that can be used to store data in the given Packet
.
packet | Target Packet . |
|
inline |
|
inline |
Append a boolean field.
type | The field type. |
value | The boolean value. |
|
inline |
Append an int field.
type | the field type |
value | the field value |
|
inline |
Append a string field, taking a copy of the parameter (raw pointer to null-terminated string).
type | The field type |
value | The string to copy (null-terminated). |
key | PSI_memory_key used to track the allocation. |
|
inline |
Append a string field, taking a copy of the parameter (raw pointer and length).
type | The field type |
value | The string to copy (not necessarily null-terminated). |
length | The number of bytes to copy |
key | PSI_memory_key used to track the allocation. |
|
inline |
Append a string field, taking a copy of the parameter (std::string).
type | The field type. |
value | The string to copy. |
key | PSI_memory_key used to track the allocation. |
|
inline |
Append a string field, sharing memory with the caller (raw pointer to null-terminated string).
type | The field type. |
value | The string to push (null-terminated). |
|
inline |
Append a string field, sharing memory with the caller (std::string).
type | The field type. |
value | String object. The pointer value.c_str() will be pushed. |
|
private |
|
private |