24#ifndef MYSQL_STRCONV_DECODE_DECODE_H
25#define MYSQL_STRCONV_DECODE_DECODE_H
56 const std::string_view &in_sv,
auto &out) {
81 const std::string_view &in_sv) {
83 return decode(opt, in_sv, string_counter);
105 if (!ret.
is_ok())
return -1;
106 return string_counter.
size();
124 const std::string_view &in_sv,
Object used to parse strings.
Definition: parser.h:69
Return_status_t read(const Is_parse_options auto &opt, Object_t &obj)
Parse into the given object.
Definition: parser.h:225
Return_status_t read_to_out_str(const Is_parse_options_nocheck auto &opt, const Is_out_str auto &out_str)
Read from this object to the given Output String Wrapper, using a decode_impl function that takes an ...
Definition: parser.h:317
std::size_t size() const
Return the current size.
Definition: string_counter.h:82
String_counter subclass that can be instantiated.
Definition: string_counter.h:97
bool is_sentinel() const
Return true if this iterator is at the end.
Definition: parse_position.h:92
void set_fullmatch_error() noexcept
Store a result representing that an object was successfully parsed from a prefix of the string,...
Definition: parse_result.h:80
bool is_ok() const
Return true if the last operation succeeded, i.e., either a full match was requested and an object wa...
Definition: parse_result.h:97
True if Test is an Output String Wrapper, i.e., derived from Out_str_base.
Definition: out_str.h:219
True for any kind of parse options: Format, Repeat, Checker, or Compound_parse_options.
Definition: parse_options.h:133
Definition: gtid_binary_format.h:41
std::ptrdiff_t compute_decoded_length(const Is_parse_options_nocheck auto &opt, const std::string_view &in_sv)
Compute the output length when parsing a string from a string.
Definition: decode.h:101
Parser decode(const Is_parse_options_nocheck auto &opt, const std::string_view &in_sv, auto &out)
Parse from a string into the given object, according to the parse options.
Definition: decode.h:55
auto out_str_growable(String_t &str)
Return a wrapper around a growable output buffer, represented as a std::string or similar type.
Definition: out_str.h:985
Parser test_decode(const Is_parse_options_nocheck auto &opt, const std::string_view &in_sv)
Test for success when parsing (decoding) a string from a string, without producing output.
Definition: decode.h:80
Return_status
Simple, strongly-typed enumeration to indicate internal status: ok, error.
Definition: return_status.h:40
Convenience function that concatenates arbitrary arguments, by feeding them to an ostringstream.