27#ifndef A11_JSON_CODEC_H_
28#define A11_JSON_CODEC_H_
33#include <absl/status/statusor.h>
34#include <nlohmann/json.hpp>
44absl::StatusOr<nlohmann::json>
ParseJson(std::string_view encoded,
45 std::string_view what);
49 std::string_view encoded, std::string_view what);
73 std::string_view what);
77 std::string_view what);
88 std::string_view what);
92 const nlohmann::ordered_json&
value, std::string_view what);
95absl::StatusOr<nlohmann::json>
UnpackMsgpack(std::string_view encoded,
96 std::string_view what);
std::string value
Definition discover.cc:100
std::optional< std::string > text
The text, where the value is a string literal or a name bound to one.
Definition discover.cc:596
absl::StatusOr< Json > ParseJson(std::string_view encoded, std::string_view what)
Parses JSON text, returning a status for invalid input.
Definition json_codec.cc:373
const Json * FindUnencodableString(const Json &value)
Definition json_codec.cc:436
absl::StatusOr< std::string > DumpOrderedJson(const nlohmann::ordered_json &value, std::string_view what)
Serialize host fields retaining their declared insertion order.
Definition json_codec.cc:444
std::string DumpJsonLossy(const Json &value)
Definition json_codec.cc:449
absl::StatusOr< Json > UnpackMsgpack(std::string_view encoded, std::string_view what)
Decodes MessagePack bytes, or explains why they are not.
Definition json_codec.cc:489
absl::StatusOr< std::string > PackOrderedMsgpack(const nlohmann::ordered_json &value, std::string_view what)
Encode host fields retaining their declared insertion order.
Definition json_codec.cc:484
absl::StatusOr< std::string > DumpJson(const Json &value, std::string_view what)
Definition json_codec.cc:440
bool IsValidUtf8(std::string_view text)
Whether text is valid strict UTF-8.
Definition json_codec.cc:383
absl::StatusOr< nlohmann::ordered_json > ParseOrderedJson(std::string_view encoded, std::string_view what)
Parse host fields retaining their declared insertion order.
Definition json_codec.cc:378
absl::StatusOr< std::string > PackMsgpack(const Json &value, std::string_view what)
Definition json_codec.cc:479