MySQL 9.1.0
Source Code Documentation
mysql::serialization::detail Namespace Reference

Functions

size_t get_size_integer_varlen_unsigned (const std::unsigned_integral auto &data)
 Calculates the number of bytes necessary to store data. More...
 
size_t get_size_integer_varlen_signed (const std::signed_integral auto &data)
 Calculates the number of bytes necessary to store data. More...
 
size_t get_size_integer_varlen (const std::unsigned_integral auto &data)
 Calculates the number of bytes necessary to store data. More...
 
size_t get_size_integer_varlen (const std::signed_integral auto &data)
 Calculates the number of bytes necessary to store data. More...
 
size_t write_varlen_bytes_unsigned (unsigned char *stream, const std::unsigned_integral auto &data)
 Writes variable-length integer to the stream. More...
 
size_t write_varlen_bytes_signed (unsigned char *stream, const std::signed_integral auto &data)
 Writes variable-length integer to the stream. More...
 
size_t write_varlen_bytes (unsigned char *stream, const std::unsigned_integral auto &data)
 Writes variable-length integer to the stream. More...
 
size_t write_varlen_bytes (unsigned char *stream, const std::signed_integral auto &data)
 Writes variable-length integer to the stream. More...
 
template<typename Type >
requires std::unsigned_integral<Type>
size_t read_varlen_bytes_unsigned (const unsigned char *stream, std::size_t stream_bytes, Type &data)
 Reads variable-length integer from the stream. More...
 
template<typename Type >
requires std::signed_integral<Type>
size_t read_varlen_bytes_signed (const unsigned char *stream, std::size_t stream_bytes, Type &data)
 Reads variable-length integer from the stream. More...
 
size_t read_varlen_bytes (const unsigned char *stream, std::size_t stream_bytes, std::unsigned_integral auto &data)
 Reads variable-length integer from the stream. More...
 
size_t read_varlen_bytes (const unsigned char *stream, std::size_t stream_bytes, std::signed_integral auto &data)
 Reads variable-length integer from the stream. More...
 

Function Documentation

◆ get_size_integer_varlen() [1/2]

size_t mysql::serialization::detail::get_size_integer_varlen ( const std::signed_integral auto &  data)

Calculates the number of bytes necessary to store data.

Template Parameters
TypeInteger type
Parameters
dataThe number to be stored into the memory
Returns
The number of bytes necessary to store data.

Enabled for signed integers

◆ get_size_integer_varlen() [2/2]

size_t mysql::serialization::detail::get_size_integer_varlen ( const std::unsigned_integral auto &  data)

Calculates the number of bytes necessary to store data.

Template Parameters
TypeInteger type
Parameters
dataThe number to be stored into the memory
Returns
The number of bytes necessary to store data.

Enabled for unsigned integers

◆ get_size_integer_varlen_signed()

size_t mysql::serialization::detail::get_size_integer_varlen_signed ( const std::signed_integral auto &  data)

Calculates the number of bytes necessary to store data.

Template Parameters
TypeInteger type
Parameters
dataThe number to be stored into the memory
Returns
The number of bytes necessary to store data.

Version for signed integers

◆ get_size_integer_varlen_unsigned()

size_t mysql::serialization::detail::get_size_integer_varlen_unsigned ( const std::unsigned_integral auto &  data)

Calculates the number of bytes necessary to store data.

Template Parameters
TypeInteger type
Parameters
dataThe number to be stored into the memory
Returns
The number of bytes necessary to store data.

◆ read_varlen_bytes() [1/2]

size_t mysql::serialization::detail::read_varlen_bytes ( const unsigned char *  stream,
std::size_t  stream_bytes,
std::signed_integral auto &  data 
)

Reads variable-length integer from the stream.

Parameters
[in]streamEncoded data
[in]stream_bytesNumber of bytes in the stream
[out]dataResult value
Returns
Number of bytes read from the stream or 0 on error. Error occurs if the stream ends before or in the middle of the encoded numbers.

◆ read_varlen_bytes() [2/2]

size_t mysql::serialization::detail::read_varlen_bytes ( const unsigned char *  stream,
std::size_t  stream_bytes,
std::unsigned_integral auto &  data 
)

Reads variable-length integer from the stream.

Parameters
[in]streamEncoded data
[in]stream_bytesNumber of bytes in the stream
[out]dataResult value
Returns
Number of bytes read from the stream or 0 on error. Error occurs if the stream ends before or in the middle of the encoded numbers.

◆ read_varlen_bytes_signed()

template<typename Type >
requires std::signed_integral<Type>
size_t mysql::serialization::detail::read_varlen_bytes_signed ( const unsigned char *  stream,
std::size_t  stream_bytes,
Type &  data 
)

Reads variable-length integer from the stream.

Parameters
[in]streamEncoded data
[in]stream_bytesNumber of bytes in the stream
[out]dataResult value
Returns
Number of bytes read from the stream or 0 on error. Error occurs if the stream ends before or in the middle of the encoded numbers.

◆ read_varlen_bytes_unsigned()

template<typename Type >
requires std::unsigned_integral<Type>
size_t mysql::serialization::detail::read_varlen_bytes_unsigned ( const unsigned char *  stream,
std::size_t  stream_bytes,
Type &  data 
)

Reads variable-length integer from the stream.

Parameters
[in]streamEncoded data
[in]stream_bytesNumber of bytes in the stream
[out]dataResult value
Returns
Number of bytes read from the stream or 0 on error. Error occurs if the stream ends before or in the middle of the encoded numbers.

◆ write_varlen_bytes() [1/2]

size_t mysql::serialization::detail::write_varlen_bytes ( unsigned char *  stream,
const std::signed_integral auto &  data 
)

Writes variable-length integer to the stream.

Parameters
[in]streamEncoded data stream
[out]dataInteger to write
Returns
Number of bytes written to the stream

Enabled for signed integers

◆ write_varlen_bytes() [2/2]

size_t mysql::serialization::detail::write_varlen_bytes ( unsigned char *  stream,
const std::unsigned_integral auto &  data 
)

Writes variable-length integer to the stream.

Parameters
[in]streamEncoded data stream
[out]dataInteger to write
Returns
Number of bytes written to the stream

Enabled for unsigned integers

◆ write_varlen_bytes_signed()

size_t mysql::serialization::detail::write_varlen_bytes_signed ( unsigned char *  stream,
const std::signed_integral auto &  data 
)

Writes variable-length integer to the stream.

Parameters
[in]streamEncoded data stream
[out]dataInteger to write
Returns
Number of bytes written to the stream

Version for signed integers

◆ write_varlen_bytes_unsigned()

size_t mysql::serialization::detail::write_varlen_bytes_unsigned ( unsigned char *  stream,
const std::unsigned_integral auto &  data 
)

Writes variable-length integer to the stream.

Parameters
[in]streamEncoded data stream
[out]dataInteger to write
Returns
Number of bytes written to the stream