24#ifndef MYSQL_STRCONV_DECODE_PARSE_POSITION_H
25#define MYSQL_STRCONV_DECODE_PARSE_POSITION_H
47template <
class Self_tp>
113 [[nodiscard]]
const unsigned char *
upos()
const {
128 [[nodiscard]]
const unsigned char *
ubegin()
const {
138 [[nodiscard]]
const char *
end()
const {
143 [[nodiscard]]
const unsigned char *
uend()
const {
CRTP base class (mixin) that makes your class a standard-compliant iterator, given only a minimal set...
Definition: iterator_interface.h:370
Base class for the current position of a string parser, holding both the parsed string and the positi...
Definition: parse_position.h:48
void advance(std::ptrdiff_t delta)
Move the iterator delta steps.
Definition: parse_position.h:79
const char * end() const
Return pointer to the end of the underlying string.
Definition: parse_position.h:138
std::size_t remaining_size() const
Return the remaining size.
Definition: parse_position.h:153
const unsigned char * ubegin() const
Return pointer to the beginning of the underlying string.
Definition: parse_position.h:128
const std::byte * bbegin() const
Return pointer to the beginning of the underlying string.
Definition: parse_position.h:133
const unsigned char * upos() const
Return the current position as an unsigned char pointer.
Definition: parse_position.h:113
Parse_position()=default
Construct a new object.
std::size_t str_size() const
Return the length of the underlying string.
Definition: parse_position.h:156
std::string_view parsed_str() const
Return a string_view over the left part of the string, up to the position.
Definition: parse_position.h:159
const char * pos() const
Return the current position as a char pointer.
Definition: parse_position.h:110
const char * get_pointer() const
Dereference the iterator and return the value.
Definition: parse_position.h:73
std::string_view str() const
Return a string_view over the underlying string.
Definition: parse_position.h:167
Parse_position(const std::string_view &source, std::size_t int_pos=0)
Construct a new Parse_position from the given range.
Definition: parse_position.h:55
const std::byte * bend() const
Return pointer to the end of the underlying string.
Definition: parse_position.h:148
std::ptrdiff_t distance_from(const Parse_position &other) const
Return the distance from iterator other to this.
Definition: parse_position.h:85
std::size_t int_pos() const
Return the current position as an integer.
Definition: parse_position.h:107
bool is_sentinel() const
Return true if this iterator is at the end.
Definition: parse_position.h:92
const char * begin() const
Return pointer to the beginning of the underlying string.
Definition: parse_position.h:125
std::contiguous_iterator_tag Iterator_category_t
Definition: parse_position.h:66
const unsigned char * uend() const
Return pointer to the end of the underlying string.
Definition: parse_position.h:143
std::size_t m_int_pos
The current position.
Definition: parse_position.h:174
void set_int_pos(std::size_t int_pos_arg)
Set the position to the given one.
Definition: parse_position.h:101
const std::byte * bpos() const
Return the current position as an std::byte pointer.
Definition: parse_position.h:118
std::string_view m_source
The beginning of the range.
Definition: parse_position.h:171
std::string_view remaining_str() const
Return a string_view over the remaining string.
Definition: parse_position.h:162
unsigned char byte
Blob class.
Definition: common.h:151
Definition: gtid_binary_format_conv.h:252
decltype(auto) uchar_cast(Type_t &&value)
Shorthand for char_cast<unsigned char>.
Definition: char_cast.h:65
decltype(auto) byte_cast(Type_t &&value)
Shorthand for char_cast<std::byte>.
Definition: char_cast.h:71
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42