24#ifndef MYSQL_STRCONV_CONV_TEXT_BASIC_H
25#define MYSQL_STRCONV_CONV_TEXT_BASIC_H
54template <std::
integral Value_t>
57 if constexpr (std::same_as<Value_t, bool>) {
61 using Unsigned_value_t = std::make_unsigned_t<Value_t>;
62 Unsigned_value_t unsigned_value{};
63 if constexpr (std::signed_integral<Value_t>) {
71 unsigned_value = Unsigned_value_t(~
value) + Unsigned_value_t(1);
73 unsigned_value = Unsigned_value_t(
value);
76 unsigned_value =
value;
92template <std::
integral Value_t>
97 std::conditional_t<std::same_as<Value_t, bool>, char, Value_t>;
101 assert(ret.ec == std::errc());
120 target.write_raw(sv);
139template <std::
integral Value_t>
145 case std::errc::invalid_argument:
148 case std::errc::result_out_of_range:
152 assert(ret.ec == std::errc());
Object used to parse strings.
Definition: parser.h:69
void set_parse_error(const std::string_view &message)
Store a result representing that the requested object could not be parsed because the string is wrong...
Definition: parser.h:94
Class that serves as the target for encode(..., Is_string_target), which never writes anything and on...
Definition: string_counter.h:40
Class that serves as the target for encode(..., Is_string_target), which writes to a char * buffer wi...
Definition: string_writer.h:43
const char * end() const
Return pointer to the end of the underlying string.
Definition: parse_position.h:138
const char * pos() const
Return the current position as a char pointer.
Definition: parse_position.h:110
Concept that holds for String_counter and String_writer.
Definition: string_target.h:111
uint counter
Definition: mysqlimport.cc:58
stdx::expected< T, std::error_code > from_chars(const std::string &value, int base=10)
convert a numeric string to a number.
Definition: destination.cc:61
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
constexpr unsigned int_log(Value_t value)
Return the base-base logarithm of value.
Definition: int_pow.h:159
Definition: gtid_binary_format.h:41
void decode_impl(const Gtid_binary_format &format, Parser &parser, mysql::gtids::Is_tag auto &tag)
Definition: gtid_binary_format_conv.h:63
void encode_impl(const Gtid_binary_format &format, Is_string_target auto &target, const mysql::gtids::Is_tag auto &tag)
Definition: gtid_binary_format_conv.h:48
Format tag to identify text format.
Definition: text_format.h:38