![]() |
MySQL 9.6.0
Source Code Documentation
|
Namespaces | |
| namespace | detail |
| namespace | throwing |
Classes | |
| struct | Binary_format |
| Format tag to identify binary format. More... | |
| struct | Boundary_set_text_format |
| Tag to identify the formatting algorithm for boundary sets of integrals, and provide the separator strings and logic to skip whitespace around tokens. More... | |
| class | Checker |
| Class holding a checker function, used to check the validity of a parsed value. More... | |
| struct | Compound_parse_options |
| Represents parse options consisting of a tuple where each of the following elements occurs optionally: Format, Repeat, Checker. More... | |
| struct | Concat_object |
Helper type that wraps the varargs of concat in a struct containing a tuple. More... | |
| struct | Debug_format |
| Format tag to identify debug format. More... | |
| class | Escaped_format |
| Format class to encode ascii strings. More... | |
| struct | Fixint_binary_format |
| Format tag to identify fixed-length-integer binary format. More... | |
| struct | Fixstr_binary_format |
| Format tag to identify fixed-length-string binary format. More... | |
| class | Fluent_parser |
| Fluent API for parsing strings. More... | |
| struct | Format_base |
| Top of the hierarchy. More... | |
| struct | Gtid_binary_format |
| struct | Gtid_text_format |
| struct | Hex_format |
| Format tag to identify hex format when encoding and decoding strings. More... | |
| struct | Nested_set_text_format |
| Tag to identify the formatting algorithm for nested sets, using the given format tags for the key type and the mapped type, respectively. More... | |
| class | Out_str_base |
| Top of the hierarchy. More... | |
| class | Out_str_fixed_ptrptr_nz |
| Non-growable output buffer wrapper, represented as raw pointers to the beginning and end, non-null-terminated. More... | |
| class | Out_str_fixed_ptrptr_z |
| Non-growable output buffer wrapper, represented as raw pointers to the beginning and end, null-terminated. More... | |
| class | Out_str_fixed_ptrsize_nz |
| Non-growable output buffer wrapper, represented as raw pointer to the beginning, and integer size, non-null-terminated. More... | |
| class | Out_str_fixed_ptrsize_z |
| Non-growable output buffer wrapper, represented as raw pointer to the beginning, and integer size, null-terminated. More... | |
| class | Out_str_fixed_string |
| Non-growable output buffer wrapper, represented as std::string. More... | |
| class | Out_str_growable_ptrptr_nz |
| Growable output buffer wrapper, represented as raw pointers to the beginning and end, non-null-terminated. More... | |
| class | Out_str_growable_ptrptr_z |
| Growable output buffer wrapper, represented as raw pointers to the beginning and end, null-terminated. More... | |
| class | Out_str_growable_ptrsize_nz |
| Growable output buffer wrapper, represented as raw pointer to the beginning, and integer size, non-null-terminated. More... | |
| class | Out_str_growable_ptrsize_z |
| Growable output buffer wrapper, represented as raw pointer to the beginning, and integer size, null-terminated. More... | |
| class | Out_str_growable_string |
| Growable output buffer wrapper, represented as std::string. More... | |
| class | Parser |
| Object used to parse strings. More... | |
| class | Repeat |
| Represents a range of integers specifying the number of times a token or pattern should be repeated when parsing a string. More... | |
| class | Repeat_optional |
| Represents a range of integers for which the lower bound is 0, representing the number of repetitions of a token when parsing a string. More... | |
| class | Streamable |
| Wrapper around an std::optional<std::string> object returned from encode, intended to be passed to operator<<, allowing it to implement ostream-idiomatic error handling. More... | |
| class | String_counter |
| Class that serves as the target for encode(..., Is_string_target), which never writes anything and only stores the size. More... | |
| class | String_writer |
Class that serves as the target for encode(..., Is_string_target), which writes to a char * buffer without bounds checking. More... | |
| struct | Text_format |
| Format tag to identify text format. More... | |
Concepts | |
| concept | Is_nested_set_text_format |
| concept | Is_checker_function |
| True for types that are invocable without arguments. | |
| concept | Is_checker |
| True for all Checker specializations. | |
| concept | Is_compound_parse_options |
| True if Test is a Compound_parse_options object with at most one Format element, at most one Repeat element, and at most one other element. | |
| concept | Is_parse_options |
| True for any kind of parse options: Format, Repeat, Checker, or Compound_parse_options. | |
| concept | Is_parse_options_nocheck |
| True for any kind of parse options: Format, Repeat, Checker, or Compound_parse_options. | |
| concept | Is_parse_options_optional |
True for any kind of parse options for which get_repeat() returns Repeat_optional, i.e., it is known at compile-time that a string of length 0 matches, and thus parse error is impossible. | |
| concept | Is_repeat |
| True if Test is either Repeat or Repeat_optional. | |
| concept | Is_out_str |
| True if Test is an Output String Wrapper, i.e., derived from Out_str_base. | |
| concept | Is_out_str_fixed |
| True if Test is an Output String Wrapper with Resize_policy fixed. | |
| concept | Is_out_str_growable |
| True if Test is an Output String Wrapper with Resize_policy growable. | |
| concept | Is_string_producer_counter |
True if Test can be invoked with a String_counter & argument and returns void or Return_status. | |
| concept | Is_string_producer_writer |
True if Test can be invoked with a String_writer & argument and returns void or Return_status. | |
| concept | Is_string_producer_pair |
True for pairs of string producer counters/writers that can be used with out_str_write, i.e., the counter accepts a String_counter &, the writer accepts a String_writer &, and the return types are either void or Return_status. | |
| concept | Is_string_producer |
True for invocables that can be used with out_str_write, i.e., which accept either a String_writer & or a String_counter & argument, and the return type is either void or Return_status. | |
| concept | Is_string_target |
| Concept that holds for String_counter and String_writer. | |
| concept | Is_format |
| True if Test is a format. | |
Typedefs | |
| using | Empty_parse_options = Compound_parse_options< std::tuple<> > |
Enumerations | |
| enum class | Skip_whitespace { no , yes } |
| enum class | Allow_redundant_separators { no , yes } |
| enum class | Allow_empty { no , yes } |
| enum class | Allow_repeated_separators { no , yes } |
Used in read_repeated_with_separators: if yes, the separator may be repeated more than once whenever it occurs. More... | |
| enum class | Leading_separators { no , yes , optional } |
Used in read_repeated_with_separators: if yes, the string must start with a separator; if no, the string must not start with a separator; if optional, the string may or may not start with a separator. More... | |
| enum class | Trailing_separators { no , yes , optional } |
Used in read_repeated_with_separators: if yes, the string must end with a separator; if no, the string must not end with a separator; if optional, the string may or may not end with a separator. More... | |
| enum class | Resize_policy { growable , fixed } |
| Indicates whether an Ouput String Wrapper is growable or fixed-size. More... | |
| enum class | Null_terminated { no , yes } |
| Indicates whether an Output String Wrapper requires that the string shall be null-terminated or not. More... | |
| enum class | Representation_type { string , ptrptr , ptrsize } |
| Indicates the type of string represention used by an Output String Wrapper. More... | |
| enum class | Target_type { counter , writer } |
| enum class | With_quotes { no , yes } |
| Whether output string should be enclosed in quote characters: "foo" vs foo. More... | |
| enum class | Preserve_high_characters { no , yes } |
| Whether ascii 128..255 should be preserved or escaped: backslash-xff vs ascii 255. More... | |
| enum class | Numeric_control_characters { no , yes } |
| Whether ascii 7..13 should use hex instead of mnemonics: backslash-x0a vs backslash-n. More... | |
| enum class | Hex_case { lower , upper , lower_only , upper_only } |
| Policy for using uppercase/lowercase in hex conversion. More... | |
Functions | |
| template<class Object_t > requires mysql::gtids::Is_tag<Object_t> || mysql::gtids::Is_gtid<Object_t> || mysql::gtids::Is_tsid<Object_t> || mysql::gtids::Is_gtid_set<Object_t> | |
| auto | get_default_format (const Binary_format &, const Object_t &) |
| void | encode_impl (const Gtid_binary_format &format, Is_string_target auto &target, const mysql::gtids::Is_tag auto &tag) |
| void | decode_impl (const Gtid_binary_format &format, Parser &parser, mysql::gtids::Is_tag auto &tag) |
| void | encode_impl (const Gtid_binary_format &format, Is_string_target auto &string_target, const mysql::gtids::Is_tsid auto &tsid) |
| void | decode_impl (const Gtid_binary_format &format, Parser &parser, mysql::gtids::Is_tsid auto &tsid) |
| void | encode_impl (const Gtid_binary_format &format, Is_string_target auto &string_target, const mysql::gtids::Is_gtid auto >id) |
| void | decode_impl (const Gtid_binary_format &format, Parser &parser, mysql::gtids::Is_gtid auto >id) |
| void | encode_impl (const Gtid_binary_format &format, Is_string_target auto &string_target, const mysql::gtids::detail::Gtid_set_header &header) |
| void | decode_impl (const Gtid_binary_format &format, Parser &parser, mysql::gtids::detail::Gtid_set_header &out) |
| void | encode_impl (const Gtid_binary_format &format, Is_string_target auto &string_target, const mysql::gtids::Is_gtid_set auto >id_set) |
| void | decode_impl (const Gtid_binary_format &format, Parser &parser, mysql::gtids::Is_gtid_set auto >id_set) |
| template<class Object_t > requires mysql::gtids::Is_tag<Object_t> || mysql::gtids::Is_gtid<Object_t> || mysql::gtids::Is_tsid<Object_t> | |
| auto | get_default_format (const Text_format &, const Object_t &) |
| template<class Object_t > requires mysql::sets::Is_nested_set<Object_t> && mysql::gtids::Is_gtid_set<Object_t> | |
| auto | get_default_format (const Text_format &, const Object_t &) |
| void | encode_impl (const Gtid_text_format &format, Is_string_target auto &target, const mysql::gtids::Is_tag auto &tag) |
| void | decode_impl (const Gtid_text_format &, Parser &parser, mysql::gtids::Is_tag auto &tag) |
| void | encode_impl (const Gtid_text_format &format, Is_string_target auto &target, const mysql::gtids::Is_tsid auto &tsid) |
| void | decode_impl (const Gtid_text_format &format, Parser &parser, mysql::gtids::Is_tsid auto &tsid) |
| void | encode_impl (const Gtid_text_format &format, Is_string_target auto &target, const mysql::gtids::Is_gtid auto >id) |
| void | decode_impl (const Gtid_text_format &format, Parser &parser, mysql::gtids::Is_gtid auto >id) |
| void | encode_impl (const Gtid_text_format &format, Is_string_target auto &target, const mysql::gtids::Is_gtid_set auto >id_set) |
| template<mysql::gtids::Is_gtid_set Gtid_set_t> | |
| void | decode_impl (const Gtid_text_format &format, Parser &parser, Gtid_set_t >id_set) |
| template<class Object_t > requires mysql::meta::Is_specialization<Object_t, mysql::sets::Interval> || mysql::sets::Is_boundary_set<Object_t> || mysql::sets::Is_interval_set<Object_t> | |
| auto | get_default_format (const Text_format &, const Object_t &) |
Make mysql::strconv::encode_text (and encode(Text_format{}, ...) use Boundary_set_text_format when the object to format is an Interval, Boundary sets, or Interval set. More... | |
| template<mysql::sets::Is_discrete_set_traits Set_traits_t> | |
| void | decode_impl (const Boundary_set_text_format &format, mysql::strconv::Parser &parser, mysql::sets::detail::Relaxed_interval< Set_traits_t > &out) |
| Enable mysql::strconv::decode(Text_format, Relaxed_interval), for boundary containers whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_container Boundary_container_t> requires mysql::sets::Is_discrete_set_traits< typename Boundary_container_t::Set_traits_t> | |
| void | decode_impl (const Boundary_set_text_format &format, mysql::strconv::Parser &parser, const std::pair< Boundary_container_t &, typename Boundary_container_t::Iterator_t & > &out) |
| Enable mysql::strconv::decode(Text_format, std::pair<Boundary_container, cursor>), for boundary containers whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_container Boundary_container_t> requires mysql::sets::Is_discrete_set_traits< typename Boundary_container_t::Set_traits_t> | |
| void | decode_impl (const Boundary_set_text_format &format, mysql::strconv::Parser &parser, Boundary_container_t &out) |
| Enable mysql::strconv::decode(Text_format, Boundary_container), for boundary containers whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_container Boundary_container_t> requires mysql::sets::Is_discrete_metric_set_traits< typename Boundary_container_t::Set_traits_t> | |
| void | decode_impl (const Binary_format &format, mysql::strconv::Parser &parser, Boundary_container_t &out) |
| Enable mysql::strconv::decode(Binary_format, Boundary_container), for boundary containers that are discrete and metric. More... | |
| template<mysql::sets::Is_boundary_container Boundary_container_t> requires mysql::sets::Is_discrete_set_traits< typename Boundary_container_t::Set_traits_t> | |
| void | decode_impl (const Fixint_binary_format &format, mysql::strconv::Parser &parser, Boundary_container_t &out) |
| Enable mysql::strconv::decode(Fixint_binary_format, Boundary_container), for boundary containers that are discrete. More... | |
| template<mysql::sets::Is_interval_container Interval_container_t> | |
| void | decode_impl (const Is_format auto &format, mysql::strconv::Parser &parser, Interval_container_t &out) |
| Enable mysql::strconv::decode(/*Format*/, Interval_container), by reading the boundaries in the given format. More... | |
| template<mysql::sets::Is_bounded_set_traits Set_traits_t> | |
| void | encode_impl (const Boundary_set_text_format &format, Is_string_target auto &target, const mysql::sets::Interval< Set_traits_t > &interval) |
| Enable mysql::strconv::encode(Boundary_set_text_format, Interval), for intervals whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_set Boundary_set_t> | |
| void | encode_impl (const Boundary_set_text_format &format, Is_string_target auto &target, const Boundary_set_t &boundary_set) |
| Enable mysql::strconv::encode(Boundary_set_text_format, Interval), for boundary sets whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_set Boundary_set_t> | |
| void | encode_impl (const Fixint_binary_format &format, Is_string_target auto &target, const Boundary_set_t &boundary_set) |
| Enable mysql::strconv::encode(Fixint_binary_format, Boundary_set), for boundary sets whose Set traits that are discrete. More... | |
| template<mysql::sets::Is_boundary_set Boundary_set_t> requires mysql::sets::Is_discrete_metric_set_traits< typename Boundary_set_t::Set_traits_t> | |
| void | encode_impl (const Binary_format &format, Is_string_target auto &target, const Boundary_set_t &boundary_set) |
| Enable mysql::strconv::encode(Binary_format, Boundary_set), for boundary sets whose Set traits that are discrete and metric. More... | |
| void | encode_impl (const Is_format auto &format, Is_string_target auto &target, const mysql::sets::Is_interval_set auto &interval_set) |
| Enable mysql::strconv::encode(/*Format*/, Interval_set), by writing the boundaries in the given format. More... | |
| void | encode_impl (const mysql::strconv::Is_nested_set_text_format auto &format, Is_string_target auto &target, const mysql::sets::Is_nested_set auto &nested_set) |
| Enable mysql::strconv::encode(/*Format*/, Nested_set), by writing the boundaries in the given format. More... | |
| auto | get_default_format (const Text_format &, const mysql::sets::Is_nested_set auto &) |
Make mysql::strconv::encode_text (and encode(Text_format{}, ...) use Nested_set_text_format when the object to format is a Nested set. More... | |
| template<Is_string_target Target_t> | |
| void | encode_impl (const Binary_format &format, Target_t &target, const std::integral auto &value) |
| Format an integer in variable-length, binary format. More... | |
| void | encode_impl (const Binary_format &format, Is_string_target auto &target, const std::string_view &sv) |
| Format a string using variable-length, binary format for the length. More... | |
| void | decode_impl (const Binary_format &format, Parser &parser, std::integral auto &out) |
Parse an integral in variable-width integer format type into out, advance the position, and return the status. More... | |
| void | decode_impl (const Binary_format &format, Parser &parser, std::string_view &out) |
Parse a string in binary format, using variable-length integer format for the length; store the result by making the given std::string_view & point directly into the input string. More... | |
| void | decode_impl (const Binary_format &format, Parser &parser, Is_string_target auto &out) |
Parse a string in binary format, using variable-length integer format for the length; make the given std::string_ref & refer to the corresponding segment of the input buffer; advance the position; and return the status. More... | |
| void | encode_impl (const Debug_format &format, Is_string_target auto &target, const detail::Parse_status &status) |
| Enable encode(Debug_format, Parse_status), to help debugging. More... | |
| void | encode (const Debug_format &format, Is_string_target auto &target, const Repeat &repeat) |
| void | encode_impl (const mysql::meta::Is_nontype_specialization< Escaped_format > auto &format, Is_string_target auto &target, const std::string_view &sv) |
| template<Is_string_target Target_t> | |
| void | encode_impl (const Fixint_binary_format &format, Target_t &target, const std::integral auto &value) |
| Format an integer in fixed-length, binary format. More... | |
| template<std::integral Value_t> | |
| void | decode_impl (const Fixint_binary_format &format, Parser &parser, Value_t &out) |
Parse an integral in fixed-width integer format type into out, advance the position, and return the status. More... | |
| void | decode_impl (const Fixstr_binary_format &format, Parser &parser, std::string_view &out) |
Parse a string in fixed-length format into out, advance the position, and return the status. More... | |
| void | decode_impl (const Fixstr_binary_format &format, Parser &parser, Is_string_target auto &out) |
Parse a string in fixed-length format into out, advance the position, and return the status. More... | |
| template<Is_string_target Target_t> | |
| void | encode_impl (const mysql::meta::Is_nontype_specialization< Hex_format > auto &format, Target_t &target, const std::string_view &sv) |
| Format the given char buffer in hex format. More... | |
| void | decode_impl (const mysql::meta::Is_nontype_specialization< Hex_format > auto &format, Parser &parser, Is_string_target auto &target) |
| Read into a single character from a string of two hex digits. More... | |
| template<std::integral Value_t> | |
| constexpr void | encode_impl (const Text_format &format, String_counter &counter, Value_t value) |
| Compute the length of a text-formatted integer. More... | |
| template<std::integral Value_t> | |
| constexpr void | encode_impl (const Text_format &format, String_writer &writer, Value_t value) |
| Write a text-formatted integer to a String_writer. More... | |
| void | encode_impl (const Text_format &format, Is_string_target auto &target, const std::string_view &sv) |
| Format the given string_view in text format, by copying the string data literally to the output buffer. More... | |
| template<std::integral Value_t> | |
| void | decode_impl (const Text_format &format, Parser &parser, Value_t &out) |
| Parse an integer in text format into out. More... | |
| void | encode_impl (const Text_format &format, Is_string_target auto &target, const Parser &obj) |
| Enable encode(Text_format, Parse_result). More... | |
| void | encode_impl (const Text_format &format, Is_string_target auto &target, const std::source_location &source_location) |
| Enable conversion from std::source_location to string. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| Parser | decode (const Is_parse_options_nocheck auto &opt, const std::string_view &in_sv, const Is_out_str auto &out_str) |
| Parse from a string into an Is_out_str object. More... | |
| Parser | decode (const Is_parse_options_nocheck auto &opt, const std::string_view &in_sv, mysql::meta::Is_specialization< std::basic_string > auto &out) |
| Parse from a string into an std::string object. More... | |
| Parser | decode_text (const std::string_view &in_sv, auto &out) |
| Parse from a string into the given object in text format. More... | |
| template<class... Args_t> | |
| Compound_parse_options (std::tuple< Args_t... >) -> Compound_parse_options< std::tuple< Args_t... > > | |
| Deduction guide. More... | |
| auto | get_format (const Is_parse_options auto &) |
| Return the Format component of any parse options that has one. More... | |
| auto | get_format (const Is_format auto &format) |
| template<Is_compound_parse_options Compound_parse_options_t> requires Compound_parse_options_t | |
| ::has_format auto | get_format (const Compound_parse_options_t &opt) |
| auto | get_repeat (const Is_parse_options auto &) |
| Return the Repeat component of any parse options, if it exists; otherwise a default-constructed Repeat object. More... | |
| auto | get_repeat (const Is_repeat auto &repeat) |
| template<Is_compound_parse_options Compound_parse_options_t> requires Compound_parse_options_t | |
| ::has_repeat auto | get_repeat (const Compound_parse_options_t &opt) |
| void | invoke_checker (const Is_parse_options auto &) |
| Invoke the Checker member of any parse options, if it exists; otherwise do nothing. More... | |
| void | invoke_checker (const Is_checker auto &checker) |
| template<Is_compound_parse_options Compound_parse_options_t> requires Compound_parse_options_t | |
| ::has_checker void | invoke_checker (const Compound_parse_options_t &opt) |
| template<Is_parse_options Opt1, Is_parse_options Opt2> | |
| auto | operator| (const Opt1 &opt1, const Opt2 &opt2) |
| Combine two Parse Options objects into one. More... | |
| constexpr bool | is_space (int x) |
| Return true if the given character is a space character, i.e., ascii 9, 10, 11, 12, 13, or 32. More... | |
| void | skip_whitespace (Parser &parser) |
| Move the position forward until end or non-whitespace. More... | |
| template<std::size_t index = 0, class... Args_t> | |
| void | encode_impl (const Is_format auto &format, Is_string_target auto &target, const Concat_object< Args_t... > &concat_object) |
| template<Is_format Format_t, class... Args_t> | |
| auto | concat_length (const Format_t &format, const Args_t &...args) noexcept |
| Compute the length of the concatenation of the string representations of the objects. More... | |
| template<Is_format Format_t, Is_out_str Out_str_t, class... Args_t> | |
| auto | concat (const Format_t &format, const Out_str_t &out, const Args_t &...args) noexcept |
| Concatenate the string representations of the objects into the output string wrapper. More... | |
| template<class String_t = std::string, Is_format Format_t, class... Args_t> | |
| auto | concat (const Format_t &format, const Args_t &...args) noexcept |
| Concatenate the string representations of the objects and return a std::optional<std::string> object holding the result. More... | |
| std::size_t | compute_encoded_length (const Is_format auto &format, const auto &object) |
| Return the string length of the object. More... | |
| void | encode (const Is_format auto &format, const Is_out_str_fixed auto &out_str, const auto &object) |
| Write the string representation of the object to the given string output wrapper. More... | |
| auto | encode (const Is_format auto &format, const Is_out_str_growable auto &out_str, const auto &object) |
| Write the string representation of the object to the given string output wrapper. More... | |
| template<class String_t = std::string> | |
| std::optional< String_t > | encode (const Is_format auto &format, const auto &object) |
| Return an std::optional<std::string> object holding the string representation of the object. More... | |
| template<class String_t = std::string> | |
| Streamable< String_t > | encode_to_streamable (const Is_format auto &format, const auto &object) |
Return a Streamable object holding the result from encode(format, object). More... | |
| std::ostream & | operator<< (std::ostream &out, const mysql::meta::Is_specialization< Streamable > auto &streamable) |
| Use output operator to write the string representation of a format-tagged object to the given ostream. More... | |
| template<class Object_t > | |
| std::size_t | compute_encoded_length_debug (const Object_t &object) |
| Return the string length of the object, using Debug_format. More... | |
| template<Is_out_str_fixed Out_str_t, class Object_t > | |
| auto | encode_debug (Out_str_t out_str, const Object_t &object) |
| Write the string representation of the object to the given string output wrapper, using Debug_format. More... | |
| template<class String_t = std::string, class Object_t > | |
| std::optional< String_t > | encode_debug (const Object_t &object) |
| Return an std::optional<std::string> object holding the string representation of the object, using Debug_format. More... | |
| template<class String_t = std::string, class... Objects_t> | |
| auto | concat_debug (const Objects_t &...objects) |
| Return an std::optional<std::string> object holding the concatenated string representations of the objects, using Debug_format. More... | |
| template<class Object_t > | |
| std::size_t | compute_encoded_length_text (const Object_t &object) |
| Return the string length of the object, using Text_format. More... | |
| template<Is_out_str_fixed Out_str_t, class Object_t > | |
| auto | encode_text (Out_str_t out_str, const Object_t &object) |
| Write the string representation of the object to the given string output wrapper, using Text_format. More... | |
| template<class String_t = std::string, class Object_t > | |
| auto | encode_text (const Object_t &object) |
| Return an std::optional<std::string> object holding the string representation of the object, using Text_format. More... | |
| template<class String_t = std::string, class... Objects_t> | |
| auto | concat_text (const Objects_t &...objects) |
| Return an std::optional<std::string> object holding the concatenated string representations of the objects, using Text_format. More... | |
| template<mysql::meta::Is_specialization< std::basic_string > String_t> | |
| auto | out_str_fixed (String_t &str) |
| Return a wrapper around a non-growable output buffer, represented as a std::string or similar type. More... | |
| template<std::integral Size_t> | |
| auto | out_str_fixed_z (mysql::meta::Is_pointer_to_charlike auto first, Size_t &length, Size_t capacity=0) |
| Return a wrapper around a non-growable, null-terminated output buffer, represented using a raw pointer to the beginning and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t, mysql::meta::Is_pointer_to< Char_t > Charptr_t> | |
| auto | out_str_fixed_z (Charptr_t first, Char_t *&last, Char_t *capacity_end=nullptr) |
| Return a wrapper around a non-growable, null-terminated output buffer, represented using raw a pointer to the beginning and a reference to a raw pointer to the end. More... | |
| template<std::integral Size_t> | |
| auto | out_str_fixed_nz (mysql::meta::Is_pointer_to_charlike auto first, Size_t &length, Size_t capacity=0) |
| Return a wrapper around a non-growable, non-null-terminated output buffer, represented using a raw pointer to the beginning and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t, mysql::meta::Is_pointer_to< Char_t > Charptr_t> | |
| auto | out_str_fixed_nz (Charptr_t first, Char_t *&last, Char_t *capacity_end=nullptr) |
| Return a wrapper around a non-growable, non-null-terminated output buffer, represented using raw a pointer to the beginning and a reference to a raw pointer to the end. More... | |
| template<std::integral Size_t, std::ptrdiff_t array_size> | |
| auto | out_str_fixed_z (mysql::meta::Is_charlike auto(&first)[array_size], Size_t &length, Size_t capacity=0) |
| Return a wrapper around a non-growable, null-terminated output buffer, represented as an array and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t, std::ptrdiff_t array_size> | |
| auto | out_str_fixed_z (Char_t(&first)[array_size], Char_t *&last, Char_t *capacity_end=nullptr) |
| Return a wrapper around a non-growable, null-terminated output buffer, represented as an array and a reference to a raw pointer to the end. More... | |
| template<std::integral Size_t, std::ptrdiff_t array_size> | |
| auto | out_str_fixed_nz (mysql::meta::Is_charlike auto(&first)[array_size], Size_t &length, Size_t capacity=0) |
| Return a wrapper around a non-growable, non-null-terminated output buffer, represented as an array and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t, std::ptrdiff_t array_size> | |
| auto | out_str_fixed_nz (Char_t(&first)[array_size], Char_t *&last, Char_t *capacity_end=nullptr) |
| Return a wrapper around a non-growable, non-null-terminated output buffer, represented as an array and a reference to a raw pointer to the end. More... | |
| template<mysql::meta::Is_specialization< std::basic_string > String_t> | |
| auto | out_str_growable (String_t &str) |
| Return a wrapper around a growable output buffer, represented as a std::string or similar type. More... | |
| template<mysql::meta::Is_charlike Char_t, std::integral Size_t> | |
| auto | out_str_growable_z (Char_t *&first, Size_t &length, Size_t capacity=0, const mysql::allocators::Memory_resource &memory_resource={}) |
| Return a wrapper around a growable, null-terminated output buffer, represented using a reference to a raw pointer to the beginning and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t> | |
| auto | out_str_growable_z (Char_t *&first, Char_t *&last, Char_t *capacity_end=nullptr, const mysql::allocators::Memory_resource &memory_resource={}) |
| Return a wrapper around a growable, null-terminated output buffer, represented using reference to a raw a pointer to the beginning and a reference to a raw pointer to the end. More... | |
| template<mysql::meta::Is_charlike Char_t, std::integral Size_t> | |
| auto | out_str_growable_nz (Char_t *&first, Size_t &length, Size_t capacity=0, const mysql::allocators::Memory_resource &memory_resource={}) |
| Return a wrapper around a growable, non-null-terminated output buffer, represented using a reference to a raw pointer to the beginning and a reference to an integral size. More... | |
| template<mysql::meta::Is_charlike Char_t> | |
| auto | out_str_growable_nz (Char_t *&first, Char_t *&last, Char_t *capacity_end=nullptr, const mysql::allocators::Memory_resource &memory_resource={}) |
| Return a wrapper around a growable, non-null-terminated output buffer, represented using reference to a raw a pointer to the beginning and a reference to a raw pointer to the end. More... | |
| template<Is_out_str Out_str_t, class Producer_counter_t , class Producer_writer_t , std::invocable Oom_action_t = detail::Nop_t> requires Is_string_producer_pair<Producer_counter_t, Producer_writer_t> | |
| mysql::utils::Return_status | out_str_write (const Out_str_t &out_str, const Producer_counter_t &producer_counter, const Producer_writer_t &producer_writer, const Oom_action_t &oom_action=detail::nop) |
| Given an Is_out_str object, a String_producer_counter, and a String_producer_writer, resizes the object as needed and then writes to it. More... | |
| template<Is_out_str_fixed Out_str_t, class Producer_counter_t , class Producer_writer_t , std::invocable Oom_action_t = detail::Nop_t> requires Is_string_producer_pair<Producer_counter_t, Producer_writer_t> && (std::same_as< std::invoke_result_t<Producer_counter_t, String_counter &>, void>) && (std::same_as< std::invoke_result_t<Producer_writer_t, String_writer &>, void>) | |
| void | out_str_write (const Out_str_t &out_str, const Producer_counter_t &producer_counter, const Producer_writer_t &producer_writer, const Oom_action_t &oom_action=detail::nop) |
| Given an Is_out_str object, a String_producer_counter, and a String_producer_writer, resizes the object as needed and then writes to it. More... | |
| template<std::invocable Oom_action_t = detail::Nop_t> | |
| auto | out_str_write (const Is_out_str auto &out_str, const Is_string_producer auto &producer, const Oom_action_t &oom_action=detail::nop) |
Given an Is_out_str object and an Is_string_producer, resize the object as needed and then write to it. More... | |
| template<std::invocable Oom_action_t = detail::Nop_t> | |
| auto | out_str_copy (const Is_out_str auto &out_str, const std::string_view &sv, const Oom_action_t &oom_action=detail::nop) |
Copy the given string_view to the Output String Wrapper, resizing as needed. More... | |
| template<Is_string_target Target_t> | |
| void | encode_impl (const Text_format &format, Target_t &target, const mysql::uuids::Uuid &uuid) |
| Enable encode_text(Uuid). More... | |
| void | decode_impl (const Text_format &format, Parser &parser, mysql::uuids::Uuid &uuid) |
| Enable decode(Text_format, string, Uuid). More... | |
| void | encode_impl (const Binary_format &, Is_string_target auto &target, const mysql::uuids::Uuid &uuid) |
| Enable encode(Binary_format, Uuid). More... | |
| void | decode_impl (const Binary_format &, Parser &parser, mysql::uuids::Uuid &uuid) |
| Enable decode(Binary_format, Uuid). More... | |
| using mysql::strconv::Empty_parse_options = typedef Compound_parse_options<std::tuple<> > |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| mysql::strconv::Compound_parse_options | ( | std::tuple< Args_t... > | ) | -> Compound_parse_options< std::tuple< Args_t... > > |
Deduction guide.
| std::ptrdiff_t mysql::strconv::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.
If this succeeds, it is guaranteed that a subsequent invocation of decode will not produce a parse_error. But note that it is possible for it to fail with an out-of-memory error.
This is an API wrapper for objects/formats for which decode_impl(opt, pos, Is_string_target) has been implemented.
| opt | Parse options, which should include the format, and may include a number of repetitions. |
| in_sv | Input represented as string_view. |
| std::size_t mysql::strconv::compute_encoded_length | ( | const Is_format auto & | format, |
| const auto & | object | ||
| ) |
Return the string length of the object.
| format | Description of output format. |
| object | Object for which the size of the string representation shall be computed. |
object, not counting any trailing '\0' characters. | std::size_t mysql::strconv::compute_encoded_length_debug | ( | const Object_t & | object | ) |
Return the string length of the object, using Debug_format.
| std::size_t mysql::strconv::compute_encoded_length_text | ( | const Object_t & | object | ) |
Return the string length of the object, using Text_format.
|
noexcept |
Concatenate the string representations of the objects and return a std::optional<std::string> object holding the result.
| String_t | Output string type. Defaults to std::string. |
| Format_t | Type of format. |
| Args_t | Types of objects. |
| format | Format object. |
| args | Objects. |
|
noexcept |
Concatenate the string representations of the objects into the output string wrapper.
| Format_t | Type of format. |
| Out_str_t | Type of output string wrapper. |
| Args_t | Types of objects. |
| format | Format object. |
| out | Output String Wrapper in which the result will be saved. |
| args | Objects. |
| auto mysql::strconv::concat_debug | ( | const Objects_t &... | objects | ) |
Return an std::optional<std::string> object holding the concatenated string representations of the objects, using Debug_format.
| String_t | Output string type. Defaults to std::string. |
| Objects_t | Types of objects. |
| objects | Objects to write. |
objects, or holding no value if an out-of-memory condition occurred.
|
noexcept |
Compute the length of the concatenation of the string representations of the objects.
| Format_t | Type of format. |
| Args_t | Types of objects. |
| format | Format object. |
| args | Objects. |
| auto mysql::strconv::concat_text | ( | const Objects_t &... | objects | ) |
Return an std::optional<std::string> object holding the concatenated string representations of the objects, using Text_format.
| String_t | Output string type. Defaults to std::string. |
| Objects_t | Types of objects. |
| objects | Objects to write. |
objects, or holding no value if an out-of-memory condition occurred. | Parser mysql::strconv::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.
| opt | Parse options, which should include the format, and may include a number of repetitions. | |
| in_sv | Input represented as string_view. | |
| [out] | out | Reference to object to read into. In case of error, this may be in a "half-parsed" state. |
| Parser mysql::strconv::decode | ( | const Is_parse_options_nocheck auto & | opt, |
| const std::string_view & | in_sv, | ||
| const Is_out_str auto & | out_str | ||
| ) |
Parse from a string into an Is_out_str object.
This is an API wrapper for objects/formats for which decode_impl(opt, pos, Is_string_target) has been implemented.
| opt | Parse options, which should include the format, and may include a number of repetitions. | |
| in_sv | Input represented as string_view. | |
| [out] | out_str | Output string wrapper to read into. In case of errors, this is unchanged. |
| Parser mysql::strconv::decode | ( | const Is_parse_options_nocheck auto & | opt, |
| const std::string_view & | in_sv, | ||
| mysql::meta::Is_specialization< std::basic_string > auto & | out | ||
| ) |
Parse from a string into an std::string object.
This is an API wrapper for objects/formats for which decode_impl(opt, pos, Is_string_target) has been implemented.
| opt | Parse options, which should include the format, and may include a number of repetitions. | |
| in_sv | Input represented as string_view. | |
| [out] | out | Reference to string to read into. In case of errors, this is unchanged. |
|
inline |
Enable decode(Binary_format, Uuid).
| void mysql::strconv::decode_impl | ( | const Binary_format & | format, |
| mysql::strconv::Parser & | parser, | ||
| Boundary_container_t & | out | ||
| ) |
Enable mysql::strconv::decode(Binary_format, Boundary_container), for boundary containers that are discrete and metric.
|
inline |
Parse a string in binary format, using variable-length integer format for the length; make the given std::string_ref & refer to the corresponding segment of the input buffer; advance the position; and return the status.
| format | Type tag to identify that this relates to binary format. | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Destination string_view which will be set to point directly into the input string. |
The possible error states are:
| void mysql::strconv::decode_impl | ( | const Binary_format & | format, |
| Parser & | parser, | ||
| std::integral auto & | out | ||
| ) |
Parse an integral in variable-width integer format type into out, advance the position, and return the status.
The format is as given by the serialization library.
| format | Type tag to identify that this relates to binary format with variable-width integers. | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Variable of integral type to read into. |
The possible error states are:
|
inline |
Parse a string in binary format, using variable-length integer format for the length; store the result by making the given std::string_view & point directly into the input string.
| format | Type tag to identify that this relates to binary format. | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Reference to std::string_view which will be set to point directly into the input string. |
The possible error states are:
| void mysql::strconv::decode_impl | ( | const Boundary_set_text_format & | format, |
| mysql::strconv::Parser & | parser, | ||
| Boundary_container_t & | out | ||
| ) |
Enable mysql::strconv::decode(Text_format, Boundary_container), for boundary containers whose Set traits that are discrete.
| void mysql::strconv::decode_impl | ( | const Boundary_set_text_format & | format, |
| mysql::strconv::Parser & | parser, | ||
| const std::pair< Boundary_container_t &, typename Boundary_container_t::Iterator_t & > & | out | ||
| ) |
Enable mysql::strconv::decode(Text_format, std::pair<Boundary_container, cursor>), for boundary containers whose Set traits that are discrete.
| void mysql::strconv::decode_impl | ( | const Boundary_set_text_format & | format, |
| mysql::strconv::Parser & | parser, | ||
| mysql::sets::detail::Relaxed_interval< Set_traits_t > & | out | ||
| ) |
Enable mysql::strconv::decode(Text_format, Relaxed_interval), for boundary containers whose Set traits that are discrete.
| void mysql::strconv::decode_impl | ( | const Fixint_binary_format & | format, |
| mysql::strconv::Parser & | parser, | ||
| Boundary_container_t & | out | ||
| ) |
Enable mysql::strconv::decode(Fixint_binary_format, Boundary_container), for boundary containers that are discrete.
| void mysql::strconv::decode_impl | ( | const Fixint_binary_format & | format, |
| Parser & | parser, | ||
| Value_t & | out | ||
| ) |
Parse an integral in fixed-width integer format type into out, advance the position, and return the status.
The format is 8 byte, little-endian.
| Value_t | Unsigned integral type to read. |
| format | Type tag to identify that this relates to binary format with fixed-width integers. | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Destination value. |
The possible error states are:
| void mysql::strconv::decode_impl | ( | const Fixstr_binary_format & | format, |
| Parser & | parser, | ||
| Is_string_target auto & | out | ||
| ) |
Parse a string in fixed-length format into out, advance the position, and return the status.
The length is not encoded in the input string; it is a nonstatic member of the format.
| format | Type tag to identify that this relates to fixed-width binary format | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Output string wrapper to store into. |
|
inline |
Parse a string in fixed-length format into out, advance the position, and return the status.
The length is not encoded in the input string; it is a nonstatic member of the format.
| format | Type tag to identify that this relates to fixed-width binary format | |
| [in,out] | parser | Parser position and parser. |
| [out] | out | Reference to string_view, which will be altered to point directly into the input string. |
|
inline |
| void mysql::strconv::decode_impl | ( | const Gtid_binary_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_gtid auto & | gtid | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_binary_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_gtid_set auto & | gtid_set | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_binary_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_tag auto & | tag | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_binary_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_tsid auto & | tsid | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_text_format & | , |
| Parser & | parser, | ||
| mysql::gtids::Is_tag auto & | tag | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_text_format & | format, |
| Parser & | parser, | ||
| Gtid_set_t & | gtid_set | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_text_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_gtid auto & | gtid | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Gtid_text_format & | format, |
| Parser & | parser, | ||
| mysql::gtids::Is_tsid auto & | tsid | ||
| ) |
| void mysql::strconv::decode_impl | ( | const Is_format auto & | format, |
| mysql::strconv::Parser & | parser, | ||
| Interval_container_t & | out | ||
| ) |
Enable mysql::strconv::decode(/*Format*/, Interval_container), by reading the boundaries in the given format.
| void mysql::strconv::decode_impl | ( | const mysql::meta::Is_nontype_specialization< Hex_format > auto & | format, |
| Parser & | parser, | ||
| Is_string_target auto & | target | ||
| ) |
Read into a single character from a string of two hex digits.
| format | Type tag to identify that this is hex format. Also holds the minimum and maximum allowed length of the resulting plaintext string. | |
| [in,out] | parser | reference to Parser |
| target | String target object to write to. |
|
inline |
Enable decode(Text_format, string, Uuid).
| void mysql::strconv::decode_impl | ( | const Text_format & | format, |
| Parser & | parser, | ||
| Value_t & | out | ||
| ) |
Parse an integer in text format into out.
| format | Type tag to identify that this relates to text format. | |
| [in,out] | parser | Parser position. |
| [out] | out | Destination value. |
The possible error states are:
| Parser mysql::strconv::decode_text | ( | const std::string_view & | in_sv, |
| auto & | out | ||
| ) |
Parse from a string into the given object in text format.
| in_sv | Input represented as string_view. | |
| [out] | out | Reference to object to read into. In case of error, this may be in a "half-parsed" state. |
| void mysql::strconv::encode | ( | const Debug_format & | format, |
| Is_string_target auto & | target, | ||
| const Repeat & | repeat | ||
| ) |
| std::optional< String_t > mysql::strconv::encode | ( | const Is_format auto & | format, |
| const auto & | object | ||
| ) |
Return an std::optional<std::string> object holding the string representation of the object.
| String_t | Output string type. Defaults to std::string. |
| format | Description of the output format. |
| object | Object to write. |
object, or holding no value if an out-of-memory condition occurred. | void mysql::strconv::encode | ( | const Is_format auto & | format, |
| const Is_out_str_fixed auto & | out_str, | ||
| const auto & | object | ||
| ) |
Write the string representation of the object to the given string output wrapper.
This overload is for the case that the output wrapper's resize policy is fixed, i.e., the caller guarantees that the output buffer has enough space to store the output. Therefore, this function cannot fail and returns void.
param format Description of output format.
param[in,out] out_str Output string wrapper to write to.
param object Object to write.
out is big enough. The length can be determined using compute_encoded_length(object). | auto mysql::strconv::encode | ( | const Is_format auto & | format, |
| const Is_out_str_growable auto & | out_str, | ||
| const auto & | object | ||
| ) |
Write the string representation of the object to the given string output wrapper.
This overload is for the case that the output wrapper's resize policy is growable. Therefore, this function can fail to allocate memory and has the [[nodiscard]] attribute.
| format | Description of output format. | |
| [in,out] | out_str | Output string wrapper to write to. |
| object | Object to write. |
out is big enough. The length can be determined using compute_encoded_length(object). | std::optional< String_t > mysql::strconv::encode_debug | ( | const Object_t & | object | ) |
Return an std::optional<std::string> object holding the string representation of the object, using Debug_format.
| String_t | Output string type. Defaults to std::string. |
| Object_t | Type of object. |
| object | Object to write. |
object, or holding no value if an out-of-memory condition occurred. | auto mysql::strconv::encode_debug | ( | Out_str_t | out_str, |
| const Object_t & | object | ||
| ) |
Write the string representation of the object to the given string output wrapper, using Debug_format.
This overload is for the case that the output wrapper's resize policy is fixed, i.e., the caller guarantees that the output buffer has enough space to store the output. Therefore, this function cannot fail and does not have the [[nodiscard]] attribute.
| Out_str_t | Type of output string wrapper to write to. |
| Object_t | Type of object. |
param[in,out] out_str Output string wrapper to write to.
param object Object to write.
out is big enough. The length can be determined using compute_encoded_length(object).This overload is for the case that the output wrapper's resize policy is growable. Therefore, this function can fail to allocate memory and has the [[nodiscard]] attribute.
| Out_str_t | Output string wrapper to write to. |
| Object_t | Type of object. |
| [in,out] | out_str | Output string wrapper to write to. |
| object | Object to write. |
out is big enough. The length can be determined using compute_encoded_length(object). | void mysql::strconv::encode_impl | ( | const Binary_format & | , |
| Is_string_target auto & | target, | ||
| const mysql::uuids::Uuid & | uuid | ||
| ) |
Enable encode(Binary_format, Uuid).
| void mysql::strconv::encode_impl | ( | const Binary_format & | format, |
| Is_string_target auto & | target, | ||
| const Boundary_set_t & | boundary_set | ||
| ) |
Enable mysql::strconv::encode(Binary_format, Boundary_set), for boundary sets whose Set traits that are discrete and metric.
| void mysql::strconv::encode_impl | ( | const Binary_format & | format, |
| Is_string_target auto & | target, | ||
| const std::string_view & | sv | ||
| ) |
Format a string using variable-length, binary format for the length.
The format is the length followed by the string data. The length is in the varint format defined in the serialization library.
| format | Type tag to identify that this relates to variable-length, binary format. | |
| [out] | target | Target object to which the string will be written. |
| sv | string_view to write. |
| void mysql::strconv::encode_impl | ( | const Binary_format & | format, |
| Target_t & | target, | ||
| const std::integral auto & | value | ||
| ) |
Format an integer in variable-length, binary format.
The format is the varint format defined in the serialization library.
| Target_t | Type of target. |
| format | Type tag to identify that this relates to binary format with variable-length integers. | |
| [out] | target | Target object to which the string will be written. |
| value | The value to write. |
| void mysql::strconv::encode_impl | ( | const Boundary_set_text_format & | format, |
| Is_string_target auto & | target, | ||
| const Boundary_set_t & | boundary_set | ||
| ) |
Enable mysql::strconv::encode(Boundary_set_text_format, Interval), for boundary sets whose Set traits that are discrete.
| void mysql::strconv::encode_impl | ( | const Boundary_set_text_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::sets::Interval< Set_traits_t > & | interval | ||
| ) |
Enable mysql::strconv::encode(Boundary_set_text_format, Interval), for intervals whose Set traits that are discrete.
| void mysql::strconv::encode_impl | ( | const Debug_format & | format, |
| Is_string_target auto & | target, | ||
| const detail::Parse_status & | status | ||
| ) |
Enable encode(Debug_format, Parse_status), to help debugging.
| void mysql::strconv::encode_impl | ( | const Fixint_binary_format & | format, |
| Is_string_target auto & | target, | ||
| const Boundary_set_t & | boundary_set | ||
| ) |
Enable mysql::strconv::encode(Fixint_binary_format, Boundary_set), for boundary sets whose Set traits that are discrete.
| void mysql::strconv::encode_impl | ( | const Fixint_binary_format & | format, |
| Target_t & | target, | ||
| const std::integral auto & | value | ||
| ) |
Format an integer in fixed-length, binary format.
The format is 8-byte, little endian.
| Target_t | Type of target. |
| format | Type tag to identify that this relates to binary format with fixed-length integers. | |
| [out] | target | Target object to which the string will be written. |
| value | The value to write. |
| void mysql::strconv::encode_impl | ( | const Gtid_binary_format & | format, |
| Is_string_target auto & | string_target, | ||
| const mysql::gtids::detail::Gtid_set_header & | header | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_binary_format & | format, |
| Is_string_target auto & | string_target, | ||
| const mysql::gtids::Is_gtid auto & | gtid | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_binary_format & | format, |
| Is_string_target auto & | string_target, | ||
| const mysql::gtids::Is_gtid_set auto & | gtid_set | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_binary_format & | format, |
| Is_string_target auto & | string_target, | ||
| const mysql::gtids::Is_tsid auto & | tsid | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_binary_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::gtids::Is_tag auto & | tag | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_text_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::gtids::Is_gtid auto & | gtid | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_text_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::gtids::Is_gtid_set auto & | gtid_set | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_text_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::gtids::Is_tag auto & | tag | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Gtid_text_format & | format, |
| Is_string_target auto & | target, | ||
| const mysql::gtids::Is_tsid auto & | tsid | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Is_format auto & | format, |
| Is_string_target auto & | target, | ||
| const Concat_object< Args_t... > & | concat_object | ||
| ) |
| void mysql::strconv::encode_impl | ( | const Is_format auto & | format, |
| Is_string_target auto & | target, | ||
| const mysql::sets::Is_interval_set auto & | interval_set | ||
| ) |
Enable mysql::strconv::encode(/*Format*/, Interval_set), by writing the boundaries in the given format.
| void mysql::strconv::encode_impl | ( | const mysql::meta::Is_nontype_specialization< Escaped_format > auto & | format, |
| Is_string_target auto & | target, | ||
| const std::string_view & | sv | ||
| ) |
| void mysql::strconv::encode_impl | ( | const mysql::meta::Is_nontype_specialization< Hex_format > auto & | format, |
| Target_t & | target, | ||
| const std::string_view & | sv | ||
| ) |
Format the given char buffer in hex format.
| format | Type tag to identify that this relates to hex format. | |
| [out] | target | Target object to which the string will be written. |
| sv | Input string. |
| void mysql::strconv::encode_impl | ( | const mysql::strconv::Is_nested_set_text_format auto & | format, |
| Is_string_target auto & | target, | ||
| const mysql::sets::Is_nested_set auto & | nested_set | ||
| ) |
Enable mysql::strconv::encode(/*Format*/, Nested_set), by writing the boundaries in the given format.
| void mysql::strconv::encode_impl | ( | const Text_format & | format, |
| Is_string_target auto & | target, | ||
| const Parser & | obj | ||
| ) |
Enable encode(Text_format, Parse_result).
This produces an error message that describes the Parse_result object to humans.
| format | Type tag to identify that this relates to text format. |
| target | String target to which the string will be appended. |
| obj | Object to write. |
| void mysql::strconv::encode_impl | ( | const Text_format & | format, |
| Is_string_target auto & | target, | ||
| const std::source_location & | source_location | ||
| ) |
Enable conversion from std::source_location to string.
| void mysql::strconv::encode_impl | ( | const Text_format & | format, |
| Is_string_target auto & | target, | ||
| const std::string_view & | sv | ||
| ) |
Format the given string_view in text format, by copying the string data literally to the output buffer.
Note that neither the string length nor any delimiter is written to the output, so a parser cannot in general compute the end in case the written string is followed by other text. Therefore there is no corresponding decode_impl function.
| format | Type tag to identify that this relates to text format. | |
| [out] | target | Target object to which the string will be written. |
| sv | Input string. |
|
constexpr |
Compute the length of a text-formatted integer.
| Value_t | Type of the value. |
| format | Type tag to identify that this relates to text format. | |
| [out] | counter | String_counter object to which the string will be written. |
| value | The value to compute the text representation length for. |
|
constexpr |
Write a text-formatted integer to a String_writer.
| Value_t | Type of the value. |
| format | Type tag to identify that this relates to text format. | |
| [out] | writer | String_writer object to which the string will be written. |
| value | The value to write. |
| void mysql::strconv::encode_impl | ( | const Text_format & | format, |
| Target_t & | target, | ||
| const mysql::uuids::Uuid & | uuid | ||
| ) |
Enable encode_text(Uuid).
| auto mysql::strconv::encode_text | ( | const Object_t & | object | ) |
Return an std::optional<std::string> object holding the string representation of the object, using Text_format.
| String_t | Output string type. Defaults to std::string. |
| Object_t | Type of object. |
| object | Object to write. |
object, or holding no value if an out-of-memory condition occurred. | auto mysql::strconv::encode_text | ( | Out_str_t | out_str, |
| const Object_t & | object | ||
| ) |
Write the string representation of the object to the given string output wrapper, using Text_format.
This overload is for the case that the output wrapper's resize policy is fixed, i.e., the caller guarantees that the output buffer has enough space to store the output. Therefore, this function cannot fail and does not have the [[nodiscard]] attribute.
| Out_str_t | Type of output string wrapper to write to. |
| Object_t | Type of object. |
param[in,out] out_str Output string wrapper to write to.
param object Object to write.
This overload is for the case that the output wrapper's resize policy is growable. Therefore, this function can fail to allocate memory and has the [[nodiscard]] attribute.
| Out_str_t | Output string wrapper to write to. |
| Object_t | Type of object. |
| [in,out] | out_str | Output string wrapper to write to. |
| object | Object to write. |
| Streamable< String_t > mysql::strconv::encode_to_streamable | ( | const Is_format auto & | format, |
| const auto & | object | ||
| ) |
Return a Streamable object holding the result from encode(format, object).
If the Streamable object is passed to operator<<, it will write the string if any, or handle the allocation error according to the stream's policy, if the allocation in encode failed.
| String_t | Output string type. Defaults to std::string. |
| format | Description of the output format. |
| object | Object to write. |
encode.Example:
| auto mysql::strconv::get_default_format | ( | const Binary_format & | , |
| const Object_t & | |||
| ) |
| auto mysql::strconv::get_default_format | ( | const Text_format & | , |
| const mysql::sets::Is_nested_set auto & | |||
| ) |
Make mysql::strconv::encode_text (and encode(Text_format{}, ...) use Nested_set_text_format when the object to format is a Nested set.
| auto mysql::strconv::get_default_format | ( | const Text_format & | , |
| const Object_t & | |||
| ) |
| auto mysql::strconv::get_default_format | ( | const Text_format & | , |
| const Object_t & | |||
| ) |
| auto mysql::strconv::get_default_format | ( | const Text_format & | , |
| const Object_t & | |||
| ) |
Make mysql::strconv::encode_text (and encode(Text_format{}, ...) use Boundary_set_text_format when the object to format is an Interval, Boundary sets, or Interval set.
| ::has_format auto mysql::strconv::get_format | ( | const Compound_parse_options_t & | opt | ) |
| auto mysql::strconv::get_format | ( | const Is_format auto & | format | ) |
| auto mysql::strconv::get_format | ( | const Is_parse_options auto & | ) |
Return the Format component of any parse options that has one.
| ::has_repeat auto mysql::strconv::get_repeat | ( | const Compound_parse_options_t & | opt | ) |
| auto mysql::strconv::get_repeat | ( | const Is_parse_options auto & | ) |
Return the Repeat component of any parse options, if it exists; otherwise a default-constructed Repeat object.
| auto mysql::strconv::get_repeat | ( | const Is_repeat auto & | repeat | ) |
| ::has_checker void mysql::strconv::invoke_checker | ( | const Compound_parse_options_t & | opt | ) |
| void mysql::strconv::invoke_checker | ( | const Is_checker auto & | checker | ) |
| void mysql::strconv::invoke_checker | ( | const Is_parse_options auto & | ) |
Invoke the Checker member of any parse options, if it exists; otherwise do nothing.
|
constexpr |
Return true if the given character is a space character, i.e., ascii 9, 10, 11, 12, 13, or 32.
This is derived from ctype_utf8mb3 and agrees with my_isspace(&my_charset_utf8mb3_general_ci, x).
| std::ostream & mysql::strconv::operator<< | ( | std::ostream & | out, |
| const mysql::meta::Is_specialization< Streamable > auto & | streamable | ||
| ) |
Use output operator to write the string representation of a format-tagged object to the given ostream.
| [out] | out | ostream to write to. |
| streamable | Streamable object to write. |
| std::ios_base::failure | if streamable does not hold a value and out.exceptions() has the badbit set. |
streamable does not hold a value, this sets badbit in out (regardless if it throws or not), and it does not write to the output. | auto mysql::strconv::operator| | ( | const Opt1 & | opt1, |
| const Opt2 & | opt2 | ||
| ) |
Combine two Parse Options objects into one.
| auto mysql::strconv::out_str_copy | ( | const Is_out_str auto & | out_str, |
| const std::string_view & | sv, | ||
| const Oom_action_t & | oom_action = detail::nop |
||
| ) |
Copy the given string_view to the Output String Wrapper, resizing as needed.
| out_str | Output String Wrapper to write to. |
| sv | string_view to write. |
| oom_action | Optional callback function. If given, will be invoked in case an out-of-memory condition occurs. |
out_str is growable, return Return_status::ok on success and Return_status::error on out-of-memory error; if out_str is fixed-size, return void. | auto mysql::strconv::out_str_fixed | ( | String_t & | str | ) |
Return a wrapper around a non-growable output buffer, represented as a std::string or similar type.
| [in,out] | str | Reference to std::string, or other type that provides similar capacity, resize, and data members. |
Out_str_base, which wraps str. | auto mysql::strconv::out_str_fixed_nz | ( | Char_t(&) | first[array_size], |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr |
||
| ) |
Return a wrapper around a non-growable, non-null-terminated output buffer, represented as an array and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically write to the character buffer and alter last to the past-the-end character.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | last | Reference to raw pointer, which writers may update to point to one-past-the-last character written. |
| capacity_end | Pointer to one-past-the-last character that may be written. May be omitted, in which case this value is taken from last instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_nz | ( | Charptr_t | first, |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr |
||
| ) |
Return a wrapper around a non-growable, non-null-terminated output buffer, represented using raw a pointer to the beginning and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically write to the character buffer and alter last to the past-the-end character.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | last | Reference to raw pointer, which writers may update to point to one-past-the-last character written. |
| capacity_end | Pointer to one-past-the-last character that may be written. May be omitted, in which case this value is taken from last instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_nz | ( | mysql::meta::Is_charlike auto(&) | first[array_size], |
| Size_t & | length, | ||
| Size_t | capacity = 0 |
||
| ) |
Return a wrapper around a non-growable, non-null-terminated output buffer, represented as an array and a reference to an integral size.
Functions accepting this type as argument will typically write to the character buffer and alter length to the past-the-end character.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters written. |
| capacity | Available capacity to write string characters. May be omitted, in which case this value is taken from length instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_nz | ( | mysql::meta::Is_pointer_to_charlike auto | first, |
| Size_t & | length, | ||
| Size_t | capacity = 0 |
||
| ) |
Return a wrapper around a non-growable, non-null-terminated output buffer, represented using a raw pointer to the beginning and a reference to an integral size.
Functions accepting this type as argument will typically write to the character buffer and alter length to the past-the-end character.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters written. May be omitted, in which case this value is taken from length instead. |
| capacity | Available capacity to write string characters. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_z | ( | Char_t(&) | first[array_size], |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr |
||
| ) |
Return a wrapper around a non-growable, null-terminated output buffer, represented as an array and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically write to the character buffer and alter last to point to the zero byte.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | last | Reference to raw pointer, which writers may update to point to the null-termination character. |
| capacity_end | Pointer to the last character that may be used for the null-termination character. Note that this is the last character included in the buffer, not one-past-the-last buffer character. May be omitted, in which case this value is taken from last instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_z | ( | Charptr_t | first, |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr |
||
| ) |
Return a wrapper around a non-growable, null-terminated output buffer, represented using raw a pointer to the beginning and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically write to the character buffer and alter last to point to the zero byte.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | last | Reference to raw pointer, which writers may update to point to the null-termination character. |
| capacity_end | Pointer to the last character that may be used for the null-termination character. Note that this is the last character included in the buffer, not one-past-the-last buffer character. May be omitted, in which case this value is taken from last instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_z | ( | mysql::meta::Is_charlike auto(&) | first[array_size], |
| Size_t & | length, | ||
| Size_t | capacity = 0 |
||
| ) |
Return a wrapper around a non-growable, null-terminated output buffer, represented as an array and a reference to an integral size.
Functions accepting this type as argument will typically write to the character buffer and alter length to point to the zero byte.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters not counting the null-termination character. |
| capacity | Available capacity to write string characters, not counting the null-termination character. Note that this should be one less than the actual buffer size. May be omitted, in which case this value is taken from length instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_fixed_z | ( | mysql::meta::Is_pointer_to_charlike auto | first, |
| Size_t & | length, | ||
| Size_t | capacity = 0 |
||
| ) |
Return a wrapper around a non-growable, null-terminated output buffer, represented using a raw pointer to the beginning and a reference to an integral size.
Functions accepting this type as argument will typically write to the character buffer and alter length to point to the zero byte.
| [in,out] | first | Raw pointer to the beginning of a character buffer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters not counting the null-termination character. |
| capacity | Available capacity to write string characters, not counting the null-termination character. Note that this should be one less than the actual buffer size. May be omitted, in which case this value is taken from length instead. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_growable | ( | String_t & | str | ) |
Return a wrapper around a growable output buffer, represented as a std::string or similar type.
| [in,out] | str | Reference to std::string, or other type that provides similar capacity, reserve, resize, and data members. |
Out_str_base, which wraps str. | auto mysql::strconv::out_str_growable_nz | ( | Char_t *& | first, |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr, |
||
| const mysql::allocators::Memory_resource & | memory_resource = {} |
||
| ) |
Return a wrapper around a growable, non-null-terminated output buffer, represented using reference to a raw a pointer to the beginning and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically allocate a new buffer and replace first by it if the given one is too small; then write to the character buffer and alter last to point to the past-the-end character.
| [in,out] | first | Reference to raw pointer to the beginning of a character buffer. May be nullptr if last is nullptr; otherwise must be a valid pointer. |
| [out] | last | Reference to raw pointer, which writers may update to point to one-past-the-last character written. |
| capacity_end | Pointer to one-past-the-last character that may be written. May be omitted, in which case this value is taken from last instead. | |
| memory_resource | Memory_resource to allocate bytes. If omitted, uses the default-constructed Memory_resource, which uses std::malloc and std::free. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_growable_nz | ( | Char_t *& | first, |
| Size_t & | length, | ||
| Size_t | capacity = 0, |
||
| const mysql::allocators::Memory_resource & | memory_resource = {} |
||
| ) |
Return a wrapper around a growable, non-null-terminated output buffer, represented using a reference to a raw pointer to the beginning and a reference to an integral size.
Functions accepting this type as argument will typically allocate a new buffer and replace first by it if the given one is too small; then write to the character buffer and alter length to the past-the-end character.
| [in,out] | first | Reference to raw pointer to the beginning of a character buffer. May be nullptr if length is 0; otherwise must be a valid pointer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters written. |
| capacity | Available capacity to write string characters. May be omitted, in which case this value is taken from length instead. | |
| memory_resource | Memory_resource to allocate bytes. If omitted, uses the default-constructed Memory_resource, which uses std::malloc and std::free. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_growable_z | ( | Char_t *& | first, |
| Char_t *& | last, | ||
| Char_t * | capacity_end = nullptr, |
||
| const mysql::allocators::Memory_resource & | memory_resource = {} |
||
| ) |
Return a wrapper around a growable, null-terminated output buffer, represented using reference to a raw a pointer to the beginning and a reference to a raw pointer to the end.
Functions accepting this type as argument will typically allocate a new buffer and replace first by it if the given one is too small; then write to the character buffer and alter last to point to the zero byte.
| [in,out] | first | Reference to raw pointer to the beginning of a character buffer. May be nullptr if last is nullptr; otherwise must be a valid pointer. |
| [out] | last | Reference to raw pointer, which writers may update to point to the null-termination character. |
| capacity_end | Pointer to the last character that may be used for the null-termination character. Note that this is the last character included in the buffer, not one-past-the-last buffer character. May be omitted, in which case this value is taken from last instead. | |
| memory_resource | Memory_resource to allocate bytes. If omitted, uses the default-constructed Memory_resource, which uses std::malloc and std::free. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_growable_z | ( | Char_t *& | first, |
| Size_t & | length, | ||
| Size_t | capacity = 0, |
||
| const mysql::allocators::Memory_resource & | memory_resource = {} |
||
| ) |
Return a wrapper around a growable, null-terminated output buffer, represented using a reference to a raw pointer to the beginning and a reference to an integral size.
Functions accepting this type as argument will typically allocate a new buffer and replace first by it if the given one is too small; then write to the character buffer and alter length to point to the zero byte.
| [in,out] | first | Reference to raw pointer to the beginning of a character buffer. May be nullptr if length is 0; otherwise must be a valid pointer. |
| [out] | length | Reference to integer, which writers may update to the number of string characters not counting the null-termination character. |
| capacity | Available capacity to write string characters, not counting the null-termination character. Note that this should be one less than the actual buffer size. May be omitted, in which case this value is taken from length instead. | |
| memory_resource | Memory_resource to allocate bytes. If omitted, uses the default-constructed Memory_resource, which uses std::malloc and std::free. |
Out_str_base, which wraps the given range of characters. | auto mysql::strconv::out_str_write | ( | const Is_out_str auto & | out_str, |
| const Is_string_producer auto & | producer, | ||
| const Oom_action_t & | oom_action = detail::nop |
||
| ) |
Given an Is_out_str object and an Is_string_producer, resize the object as needed and then write to it.
| out_str | Wrapper around the output, typically obtained from one of the out_str_* functions. |
| producer | Function that writes to its Is_string_target parameter, and returns either Return_status indicating success or failure, or (if it can't fail) void. |
| oom_action | Optional callback function. If given, will be invoked in case an out-of-memory condition occurs. |
out_str is growable or producer returns non-void, returns Return_status to indicate success or failure; otherwise returns void. | mysql::utils::Return_status mysql::strconv::out_str_write | ( | const Out_str_t & | out_str, |
| const Producer_counter_t & | producer_counter, | ||
| const Producer_writer_t & | producer_writer, | ||
| const Oom_action_t & | oom_action = detail::nop |
||
| ) |
Given an Is_out_str object, a String_producer_counter, and a String_producer_writer, resizes the object as needed and then writes to it.
This overload is for when there are error cases, i.e., when either the producer can return errors, or the Output String Wrapper is growable.
| Out_str_t | Type of Output String Wrapper. |
| Producer_counter_t | Type of the producer counter function. |
| Producer_writer_t | Type of the producer writer function. Producer_counter_t and Producer_writer_t must satisfy Is_string_producer_pair (including the semantic requirements). |
| out_str | Wrapper around the output, typically obtained from one of the out_str_* functions. |
| producer_counter | Function that writes to its String_counter & parameter, and returns either Return_status indicating success or failure, or void (if it can't fail). |
| producer_writer | Function that writes to its String_writer & parameter, and returns either Return_status indicating success or failure, or void (if it can't fail). |
| oom_action | Optional callback function. If given, will be invoked in case an out-of-memory condition occurs. |
Return_status::error if either write or out_str.resize returns Return_status::error; otherwise Return_status::ok. | void mysql::strconv::out_str_write | ( | const Out_str_t & | out_str, |
| const Producer_counter_t & | producer_counter, | ||
| const Producer_writer_t & | producer_writer, | ||
| const Oom_action_t & | oom_action = detail::nop |
||
| ) |
Given an Is_out_str object, a String_producer_counter, and a String_producer_writer, resizes the object as needed and then writes to it.
This overload is for when there are no error cases, i.e., when the producer returns void and the Output String Wrapper is fixed-size.
| Out_str_t | Type of output wrapper. |
| Producer_counter_t | Type of the producer counter function. |
| Producer_writer_t | Type of the producer writer function. Producer_counter_t and Producer_writer_t must satisfy Is_string_producer_pair (including the semantic requirements). |
| out_str | Wrapper around the output, typically obtained from one of the out_str_* functions. |
| producer_counter | Function that writes to its String_counter & parameter, and returns either Return_status indicating success or failure, or void (if it can't fail). |
| producer_writer | Function that writes to its String_writer & parameter, and returns either Return_status indicating success or failure, or void (if it can't fail). |
| oom_action | Optional callback function. If given, will be invoked in case an out-of-memory condition occurs. |
|
inline |
Move the position forward until end or non-whitespace.
| Parser mysql::strconv::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.
If this succeeds, it is guaranteed that a subsequent invocation of decode will not produce a parse_error. But note that it is possible for it to fail with an out-of-memory error.
This is an API wrapper for objects/formats for which decode_impl(opt, pos, Is_string_target) has been implemented.
| opt | Parse options, which should include the format, and may include a number of repetitions. |
| in_sv | Input represented as string_view. |