Lines Matching refs:string

20 #include <string> // char_traits, string
187 @brief Parses a C-style string from the BSON input.
188 @param[in,out] result A reference to the string variable where the read
189 string is to be stored.
190 @return `true` if the \x00-byte indicating the end of the string was
212 @brief Parses a zero-terminated string of length @a len from the BSON
215 string to be read.
216 @param[in,out] result A reference to the string variable where the read
217 string is to be stored.
220 @return `true` if the string was successfully parsed
229 exception_message(input_format_t::bson, concat("string length must be at least 1, is ", std::to_string(len)), "string"), nullptr));
283 case 0x02: // string
287 return get_number<std::int32_t, true>(input_format_t::bson, len) && get_bson_string(len, value) && sax->string(value);
333 std::string cr_str{cr.data()};
567 // UTF-8 string (0x00..0x17 bytes follow)
592 case 0x78: // UTF-8 string (one-byte uint8_t for n follows)
593 case 0x79: // UTF-8 string (two-byte uint16_t for n follow)
594 case 0x7A: // UTF-8 string (four-byte uint32_t for n follow)
595 case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow)
596 case 0x7F: // UTF-8 string (indefinite length)
599 return get_cbor_string(s) && sax->string(s);
901 @brief reads a CBOR string
904 string length and then copies this number of bytes into a string.
907 @param[out] result created string
909 @return whether string creation completed
913 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "string")))
920 // UTF-8 string (0x00..0x17 bytes follow)
949 case 0x78: // UTF-8 string (one-byte uint8_t for n follows)
955 case 0x79: // UTF-8 string (two-byte uint16_t for n follow)
961 case 0x7A: // UTF-8 string (four-byte uint32_t for n follow)
967 case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow)
973 case 0x7F: // UTF-8 string (indefinite length)
991 exception_message(input_format_t::cbor, concat("expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x", last_token), "string"), nullptr));
1411 return get_msgpack_string(s) && sax->string(s);
1568 @brief reads a MessagePack string
1571 string length and then copies this number of bytes into a string.
1573 @param[out] result created string
1575 @return whether string creation completed
1579 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string")))
1645 exception_message(input_format_t::msgpack, concat("expected length specification (0xA0-0xBF, 0xD9-0xDB); last byte: 0x", last_token), "string"), nullptr));
1836 @brief reads a UBJSON string
1839 indicating a string, or in case of an object key where the 'S' byte can be
1842 @param[out] result created string
1847 @return whether string creation completed
1927 std::string message;
1937 return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format, message, "string"), nullptr));
2208 std::string message;
2457 return sax->string(s);
2460 case 'S': // string
2463 return get_ubjson_string(s) && sax->string(s);
2508 string_t type = it->second; // sax->string() takes a reference
2509 if (JSON_HEDLEY_UNLIKELY(!sax->key(key) || !sax->string(type)))
2675 // get size of following number string
2684 // get number string
2696 // parse number string
2817 @brief create a string by reading characters from the input
2822 @param[out] result string created by reading @a len bytes
2824 @return whether string creation completed
2828 the input before we run out of string memory.
2839 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "string")))
2899 @return a string representation of the last read byte
2901 std::string get_token_string() const
2905 return std::string{cr.data()};
2912 @return a message string to use in the parse_error exceptions
2914 std::string exception_message(const input_format_t format,
2915 const std::string& detail,
2916 const std::string& context) const
2918 std::string error_msg = "syntax error while parsing ";