1#ifndef SIMDJSON_GENERIC_FRACTURED_JSON_BUILDER_H
2#define SIMDJSON_GENERIC_FRACTURED_JSON_BUILDER_H
4#ifndef SIMDJSON_CONDITIONAL_INCLUDE
5#include "simdjson/generic/builder/json_builder.h"
6#include "simdjson/dom/fractured_json.h"
9#if SIMDJSON_STATIC_REFLECTION
12namespace SIMDJSON_IMPLEMENTATION {
38simdjson_warn_unused simdjson_result<std::string> to_fractured_json_string(
40 const fractured_json_options& opts = {},
41 size_t initial_capacity = string_builder::DEFAULT_INITIAL_CAPACITY) {
43 std::string formatted;
67template<constevalutil::fixed_string... FieldNames,
typename T>
68 requires(std::is_class_v<T> && (
sizeof...(FieldNames) > 0))
69simdjson_warn_unused simdjson_result<std::string> extract_fractured_json(
71 const fractured_json_options& opts = {},
72 size_t initial_capacity = string_builder::DEFAULT_INITIAL_CAPACITY) {
74 std::string formatted;
75 auto error = extract_from<FieldNames...>(obj, initial_capacity).get(formatted);
94simdjson_warn_unused simdjson_result<std::string> to_fractured_json_string(
96 const fractured_json_options& opts = {},
97 size_t initial_capacity = SIMDJSON_IMPLEMENTATION::builder::string_builder::DEFAULT_INITIAL_CAPACITY) {
98 return SIMDJSON_IMPLEMENTATION::builder::to_fractured_json_string(obj, opts, initial_capacity);
104template<constevalutil::fixed_string... FieldNames,
typename T>
105 requires(std::is_class_v<T> && (
sizeof...(FieldNames) > 0))
106simdjson_warn_unused simdjson_result<std::string> extract_fractured_json(
108 const fractured_json_options& opts = {},
109 size_t initial_capacity = SIMDJSON_IMPLEMENTATION::builder::string_builder::DEFAULT_INITIAL_CAPACITY) {
110 return SIMDJSON_IMPLEMENTATION::builder::extract_fractured_json<FieldNames...>(obj, opts, initial_capacity);
The top level simdjson namespace, containing everything the library provides.
simdjson_result< std::string_view > to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::document &x) noexcept
Create a string-view instance out of a document instance.
std::string fractured_json_string(std::string_view json_str)
Format a JSON string using FracturedJson formatting.