simdjson 4.0.7
Ridiculously Fast JSON
Loading...
Searching...
No Matches
serialization.h
1#ifndef SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H
2
3#ifndef SIMDJSON_CONDITIONAL_INCLUDE
4#define SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H
5#include "simdjson/generic/ondemand/base.h"
6#endif // SIMDJSON_CONDITIONAL_INCLUDE
7
8namespace simdjson {
14inline simdjson_result<std::string_view> to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::document& x) noexcept;
21inline simdjson_result<std::string_view> to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::value& x) noexcept;
27inline simdjson_result<std::string_view> to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::object& x) noexcept;
33inline simdjson_result<std::string_view> to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::array& x) noexcept;
34inline simdjson_result<std::string_view> to_json_string(simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::document> x);
35inline simdjson_result<std::string_view> to_json_string(simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> x);
36inline simdjson_result<std::string_view> to_json_string(simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object> x);
37inline simdjson_result<std::string_view> to_json_string(simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array> x);
38
39#if SIMDJSON_STATIC_REFLECTION
44template<typename T>
45 requires(!std::same_as<T, SIMDJSON_IMPLEMENTATION::ondemand::document> &&
46 !std::same_as<T, SIMDJSON_IMPLEMENTATION::ondemand::value> &&
47 !std::same_as<T, SIMDJSON_IMPLEMENTATION::ondemand::object> &&
48 !std::same_as<T, SIMDJSON_IMPLEMENTATION::ondemand::array>)
49inline std::string to_json_string(const T& obj);
50#endif
51
52} // namespace simdjson
53
61namespace simdjson { namespace SIMDJSON_IMPLEMENTATION { namespace ondemand {
62
71inline std::ostream& operator<<(std::ostream& out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value x);
72#if SIMDJSON_EXCEPTIONS
73inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result<simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value> x);
74#endif
83inline std::ostream& operator<<(std::ostream& out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array value);
84#if SIMDJSON_EXCEPTIONS
85inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result<simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array> x);
86#endif
95inline std::ostream& operator<<(std::ostream& out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document& value);
96#if SIMDJSON_EXCEPTIONS
97inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result<simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document>&& x);
98#endif
99inline std::ostream& operator<<(std::ostream& out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference& value);
100#if SIMDJSON_EXCEPTIONS
101inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result<simdjson::SIMDJSON_IMPLEMENTATION::ondemand::document_reference>&& x);
102#endif
111inline std::ostream& operator<<(std::ostream& out, simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object value);
112#if SIMDJSON_EXCEPTIONS
113inline std::ostream& operator<<(std::ostream& out, simdjson::simdjson_result<simdjson::SIMDJSON_IMPLEMENTATION::ondemand::object> x);
114#endif
115}}} // namespace simdjson::SIMDJSON_IMPLEMENTATION::ondemand
116
117#endif // SIMDJSON_GENERIC_ONDEMAND_SERIALIZATION_H
A document_reference is a thin wrapper around a document reference instance.
Definition document.h:798
A forward-only JSON object field iterator.
Definition object.h:20
An ephemeral JSON value returned during iteration.
Definition value.h:21
The top level simdjson namespace, containing everything the library provides.
Definition base.h:8
simdjson_result< std::string_view > to_json_string(SIMDJSON_IMPLEMENTATION::ondemand::document &x) noexcept
Create a string-view instance out of a document instance.
The result of a simdjson operation that could fail.
Definition error.h:278