1 #ifndef SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H
3 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
4 #define SIMDJSON_GENERIC_ONDEMAND_RAW_JSON_STRING_H
5 #include "simdjson/generic/ondemand/base.h"
6 #include "simdjson/generic/implementation_simdjson_result_base.h"
10 namespace SIMDJSON_IMPLEMENTATION {
59 simdjson_inline const
char *
raw() const noexcept;
75 simdjson_inline
bool unsafe_is_equal(
size_t length, std::string_view target) const noexcept;
92 simdjson_inline
bool unsafe_is_equal(std::string_view target) const noexcept;
106 simdjson_inline
bool unsafe_is_equal(const
char* target) const noexcept;
112 simdjson_inline
bool is_equal(std::string_view target) const noexcept;
118 simdjson_inline
bool is_equal(const
char* target) const noexcept;
135 simdjson_inline
void consume() noexcept { buf =
nullptr; }
140 simdjson_inline simdjson_warn_unused
bool alive() const noexcept {
return buf !=
nullptr; }
166 const uint8_t * buf{};
173 simdjson_unused simdjson_inline std::ostream &
operator<<(std::ostream &,
const raw_json_string &) noexcept;
179 simdjson_unused simdjson_inline
bool operator==(
const raw_json_string &a, std::string_view c) noexcept;
180 simdjson_unused simdjson_inline
bool operator==(std::string_view c,
const raw_json_string &a) noexcept;
181 simdjson_unused simdjson_inline
bool operator!=(
const raw_json_string &a, std::string_view c) noexcept;
182 simdjson_unused simdjson_inline
bool operator!=(std::string_view c,
const raw_json_string &a) noexcept;
200 simdjson_inline simdjson_warn_unused
simdjson_result<std::string_view> unescape(SIMDJSON_IMPLEMENTATION::ondemand::json_iterator &iter,
bool allow_replacement)
const noexcept;
A string escaped per JSON rules, terminated with quote (").
simdjson_inline bool is_equal(std::string_view target) const noexcept
This compares the current instance to the std::string_view target: returns true if they are byte-by-b...
static simdjson_inline bool is_free_from_unescaped_quote(std::string_view target) noexcept
Returns true if target is free from unescaped quote.
simdjson_inline raw_json_string() noexcept=default
Create a new invalid raw_json_string.
simdjson_inline const char * raw() const noexcept
Get the raw pointer to the beginning of the string in the JSON (just after the ").
simdjson_inline bool unsafe_is_equal(size_t length, std::string_view target) const noexcept
This compares the current instance to the std::string_view target: returns true if they are byte-by-b...
simdjson_unused simdjson_inline bool operator==(const raw_json_string &a, std::string_view c) noexcept
Comparisons between raw_json_string and std::string_view instances are potentially unsafe: the user i...
std::ostream & operator<<(std::ostream &out, json_type type) noexcept
Write the JSON type to the output stream.
The top level simdjson namespace, containing everything the library provides.
error_code
All possible errors returned by simdjson.
The result of a simdjson operation that could fail.
The result of a simdjson operation that could fail.
simdjson_inline error_code error() const noexcept
The error.
simdjson_inline T & value() &noexcept(false)
Get the result value.