MySQL 8.4.0
Source Code Documentation
anonymous_namespace{opt_trace.cc}::Buffer Class Reference

A wrapper of class String, for storing query or trace. More...

Public Member Functions

 Buffer ()
 
size_t alloced_length () const
 
size_t length () const
 
void prealloc ()
 pro-actively extend buffer if soon short of space More...
 
char * c_ptr_safe ()
 
const char * ptr () const
 
const CHARSET_INFOcharset () const
 
void set_charset (const CHARSET_INFO *charset)
 
void append (const char *str, size_t length)
 Like String::append() More...
 
void append (const char *str)
 
void append_escaped (const char *str, size_t length)
 Like append() but escapes certain characters for string values to be JSON-compliant. More...
 
void append (char chr)
 
size_t get_allowed_mem_size () const
 
size_t get_missing_bytes () const
 
void set_allowed_mem_size (size_t a)
 

Private Attributes

size_t allowed_mem_size
 allowed memory size for this String More...
 
size_t missing_bytes
 how many bytes could not be added More...
 
String string_buf
 

Detailed Description

A wrapper of class String, for storing query or trace.

Any memory allocation error in this class is reported by my_error(), see OOM_HANDLING in opt_trace.h.

Constructor & Destructor Documentation

◆ Buffer()

anonymous_namespace{opt_trace.cc}::Buffer::Buffer ( )
inline

Member Function Documentation

◆ alloced_length()

size_t anonymous_namespace{opt_trace.cc}::Buffer::alloced_length ( ) const
inline

◆ append() [1/3]

void anonymous_namespace{opt_trace.cc}::Buffer::append ( char  chr)

◆ append() [2/3]

void anonymous_namespace{opt_trace.cc}::Buffer::append ( const char *  str)
inline

◆ append() [3/3]

void anonymous_namespace{opt_trace.cc}::Buffer::append ( const char *  str,
size_t  length 
)

Like String::append()

Parameters
strString, in this instance's charset
lengthlength of string

◆ append_escaped()

void anonymous_namespace{opt_trace.cc}::Buffer::append_escaped ( const char *  str,
size_t  length 
)

Like append() but escapes certain characters for string values to be JSON-compliant.

Parameters
strString in UTF8
lengthlength of string

◆ c_ptr_safe()

char * anonymous_namespace{opt_trace.cc}::Buffer::c_ptr_safe ( )
inline

◆ charset()

const CHARSET_INFO * anonymous_namespace{opt_trace.cc}::Buffer::charset ( ) const
inline

◆ get_allowed_mem_size()

size_t anonymous_namespace{opt_trace.cc}::Buffer::get_allowed_mem_size ( ) const
inline

◆ get_missing_bytes()

size_t anonymous_namespace{opt_trace.cc}::Buffer::get_missing_bytes ( ) const
inline

◆ length()

size_t anonymous_namespace{opt_trace.cc}::Buffer::length ( ) const
inline

◆ prealloc()

void anonymous_namespace{opt_trace.cc}::Buffer::prealloc ( )

pro-actively extend buffer if soon short of space

◆ ptr()

const char * anonymous_namespace{opt_trace.cc}::Buffer::ptr ( ) const
inline

◆ set_allowed_mem_size()

void anonymous_namespace{opt_trace.cc}::Buffer::set_allowed_mem_size ( size_t  a)
inline

◆ set_charset()

void anonymous_namespace{opt_trace.cc}::Buffer::set_charset ( const CHARSET_INFO charset)
inline

Member Data Documentation

◆ allowed_mem_size

size_t anonymous_namespace{opt_trace.cc}::Buffer::allowed_mem_size
private

allowed memory size for this String

◆ missing_bytes

size_t anonymous_namespace{opt_trace.cc}::Buffer::missing_bytes
private

how many bytes could not be added

◆ string_buf

String anonymous_namespace{opt_trace.cc}::Buffer::string_buf
private

The documentation for this class was generated from the following file: