Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
Thoth::NJson Namespace Reference

Namespaces

namespace  Details
 

Classes

struct  Json
 
struct  JsonObject
 
struct  StringRef
 

Typedefs

using Null = std::monostate
 
using String = Dsa::Cow< StringRef, std::string >
 
using Number = long double
 
using Bool = bool
 
using Object = std::unique_ptr< JsonObject >
 
using Array = std::vector< Json >
 
using RefValWrapper = Json *
 
using CRefValWrapper = const Json *
 
using OptRefValWrapper = std::optional< RefValWrapper >
 
using OptCRefValWrapper = std::optional< CRefValWrapper >
 
using ExpRefValWrapper = std::expected< RefValWrapper, Http::RequestError >
 
using ExpCRefValWrapper = std::expected< CRefValWrapper, Http::RequestError >
 
using ValWrapper = Json
 
using CValWrapper = const Json
 
using OptValWrapper = std::optional< ValWrapper >
 
using OptCValWrapper = std::optional< CValWrapper >
 
using ExpValWrapper = std::expected< ValWrapper, Http::RequestError >
 
using ExpCValWrapper = std::expected< CValWrapper, Http::RequestError >
 
using JsonObjKey = std::string
 
using JsonObjKeyRef = std::string_view
 
using Key = std::variant< int, JsonObjKey >
 
using Keys = std::span< const Key >
 

Functions

template<class ... T>
requires ((std::unsigned_integral<T> || std::convertible_to<T, std::string_view>) &&...)
auto MakeKeys (const T &... keys)
 
template<class ... T>
requires (std::constructible_from<Json::Value, T>, ...)
Array MakeArray (T &&... ts)
 
template<class... P>
requires (std::constructible_from<Json, typename P::second_type> && ...)
JsonObject MakeObject (P &&... ts)
 

Typedef Documentation

◆ Array

using Thoth::NJson::Array = typedef std::vector<Json>

◆ Bool

using Thoth::NJson::Bool = typedef bool

◆ CRefValWrapper

using Thoth::NJson::CRefValWrapper = typedef const Json*

◆ CValWrapper

using Thoth::NJson::CValWrapper = typedef const Json

◆ ExpCRefValWrapper

◆ ExpCValWrapper

◆ ExpRefValWrapper

◆ ExpValWrapper

◆ JsonObjKey

typedef std::string Thoth::NJson::JsonObjKey

◆ JsonObjKeyRef

typedef std::string_view Thoth::NJson::JsonObjKeyRef

◆ Key

using Thoth::NJson::Key = typedef std::variant<int, JsonObjKey>

◆ Keys

using Thoth::NJson::Keys = typedef std::span<const Key>

◆ Null

using Thoth::NJson::Null = typedef std::monostate

◆ Number

using Thoth::NJson::Number = typedef long double

◆ Object

using Thoth::NJson::Object = typedef std::unique_ptr<JsonObject>

◆ OptCRefValWrapper

using Thoth::NJson::OptCRefValWrapper = typedef std::optional<CRefValWrapper>

◆ OptCValWrapper

using Thoth::NJson::OptCValWrapper = typedef std::optional<CValWrapper>

◆ OptRefValWrapper

using Thoth::NJson::OptRefValWrapper = typedef std::optional<RefValWrapper>

◆ OptValWrapper

using Thoth::NJson::OptValWrapper = typedef std::optional<ValWrapper>

◆ RefValWrapper

◆ String

using Thoth::NJson::String = typedef Dsa::Cow<StringRef, std::string>

◆ ValWrapper

using Thoth::NJson::ValWrapper = typedef Json

Function Documentation

◆ MakeArray()

template<class ... T>
requires (std::constructible_from<Json::Value, T>, ...)
Array Thoth::NJson::MakeArray ( T &&...  ts)

◆ MakeKeys()

template<class ... T>
requires ((std::unsigned_integral<T> || std::convertible_to<T, std::string_view>) &&...)
auto Thoth::NJson::MakeKeys ( const T &...  keys)

◆ MakeObject()

template<class... P>
requires (std::constructible_from<Json, typename P::second_type> && ...)
JsonObject Thoth::NJson::MakeObject ( P &&...  ts)