8#include "simdjson/common_defs.h"
9#include "simdjson/compiler_check.h"
10#include "simdjson/error.h"
11#include "simdjson/portability.h"
12#include "simdjson/concepts.h"
13#include "simdjson/constevalutil.h"
15#if SIMDJSON_SUPPORTS_CHAR8_T
25SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS
51SIMDJSON_POP_DISABLE_UNUSED_WARNINGS
86class dom_parser_implementation;
87class escape_json_string;
92#if SIMDJSON_SUPPORTS_CHAR8_T
100simdjson_inline std::u8string_view as_u8string_view(std::string_view v)
noexcept {
101 return std::u8string_view(
reinterpret_cast<const char8_t *
>(v.data()), v.size());
111template <
typename string_type>
112simdjson_inline
void assign_utf8(string_type &receiver, std::string_view content)
noexcept {
116#if SIMDJSON_SUPPORTS_CHAR8_T
123template <
typename traits_type,
typename allocator_type>
124simdjson_inline
void assign_utf8(std::basic_string<char8_t, traits_type, allocator_type> &receiver, std::string_view content)
noexcept {
125 receiver.assign(
reinterpret_cast<const char8_t *
>(content.data()), content.size());
132template <
typename traits_type>
133simdjson_inline
void assign_utf8(std::basic_string_view<char8_t, traits_type> &receiver, std::string_view content)
noexcept {
134 receiver = std::basic_string_view<char8_t, traits_type>(
reinterpret_cast<const char8_t *
>(content.data()), content.size());
An implementation of simdjson for a particular CPU architecture.
User-provided string that promises it has extra padded bytes at the end for use with parser::parse().
The top level simdjson namespace, containing everything the library provides.
constexpr size_t SIMDJSON_MAX_DEPTH
The maximum depth of nested objects and arrays supported by simdjson.
stream_format
Stream format for parse_many/iterate_many.
@ comma_delimited
Comma-separated JSON documents (e.g., {...},{...},{...})
@ whitespace_delimited
Whitespace-delimited JSON documents (default, includes NDJSON/JSONL)
@ newline_delimited
NDJSON/JSON Lines where each document occupies exactly one line: documents are separated by line feed...
@ comma_delimited_array
A single JSON array whose elements are iterated as comma-separated documents (e.g....
@ json_sequence
RFC 7464 JSON text sequences (RS-delimited)
constexpr size_t DEFAULT_MAX_DEPTH
By default, simdjson supports this many nested objects and arrays.
SIMDJSON_PUSH_DISABLE_UNUSED_WARNINGS constexpr size_t SIMDJSON_MAXSIZE_BYTES
The maximum document size supported by simdjson.
stage1_mode
This enum is used with the dom_parser_implementation::stage1 function.
constexpr size_t SIMDJSON_PADDING
The amount of padding needed in a buffer to parse JSON.
String with extra allocation for ease of use with parser::parse()