Skip to content
Welcome to the new CppUtils documentation!

Namespace: CppUtils::Language::JSON

using CppUtils::Language::JSON::Object = typedef std::map<std::string, Value, std::less<> >;
using CppUtils::Language::JSON::Array = typedef std::vector<Value>;
auto parseTree(std::string_view src) -> Container::Tree::VariantNode<Type::Token, bool, float>;

template <std::output_iterator< char > Iterator>
auto escapeString(std::string_view string, Iterator out) -> Iterator;

auto operator<<(std::ostream& os, const Value& value) -> std::ostream &;

template <class ObjectType, class Mapping>
auto toStruct(const Value& jsonValue) -> ObjectType;

template <class ObjectType, class Mapping>
auto toStructs(const Value& jsonValue, std::vector<ObjectType> &&objects={}) -> std::vector<ObjectType>;

template <class ObjectType, class Mapping>
auto toJSON(const ObjectType& objectValue) -> Value;

auto parseJSON(std::string_view json) -> std::expected<Value, Error>;

template <class T, class Mapping>
auto loadFile(const std::filesystem::path& filePath) -> std::expected<T, Error>;

constinit const auto CppUtils::Language::JSON::nullValue;