Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
Thoth::Http::NHeaders::ValueProxy< IsConst, Ts > Struct Template Reference

#include <ValueProxy.hpp>

Classes

struct  First
 

Public Types

using HeaderType = std::conditional_t< IsConst, const Headers, Headers >
 
using PatternType = std::conditional_t< Single, std::string_view, std::array< std::string_view, Count > >
 
using Type = std::conditional_t< Single, typename First< Ts... >::Type, std::variant< Ts... > >
 

Public Member Functions

 ValueProxy (ValueProxy &&)=delete
 
 ValueProxy (const ValueProxy &)=delete
 
 ValueProxy (std::string_view key, HeaderType &headers, PatternType inPattern={})
 
std::optional< TypeGetAsOpt () &&
 
std::expected< Type, HeaderErrorEnumGet () &&
 
std::expected< Type, InvalidHeaderFormatGetWithDefault (Type defaultValue) &&
 
template<class T >
requires (!IsConst)
void operator= (const T &newValue) &&
 
template<class T >
requires (!IsConst)
void operator= (T &&newValue) &&
 
template<class T >
requires (!IsConst)
void Set (const T &newValue) &&
 
template<class T >
requires (!IsConst)
void Set (T &&newValue) &&
 
template<class = void>
requires (!IsConst)
bool TrySet (std::string_view newValue) &&
 

Static Public Attributes

static constexpr int Count { sizeof...(Ts) }
 
static constexpr int Single { sizeof...(Ts) == 1 }
 

Member Typedef Documentation

◆ HeaderType

template<bool IsConst, Serializable ... Ts>
using Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::HeaderType = std::conditional_t<IsConst, const Headers, Headers>

◆ PatternType

template<bool IsConst, Serializable ... Ts>
using Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::PatternType = std::conditional_t<Single, std::string_view, std::array<std::string_view, Count> >

◆ Type

template<bool IsConst, Serializable ... Ts>
using Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Type = std::conditional_t<Single, typename First<Ts...>::Type, std::variant<Ts...> >

Constructor & Destructor Documentation

◆ ValueProxy() [1/3]

template<bool IsConst, Serializable ... Ts>
Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::ValueProxy ( ValueProxy< IsConst, Ts > &&  )
delete

◆ ValueProxy() [2/3]

template<bool IsConst, Serializable ... Ts>
Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::ValueProxy ( const ValueProxy< IsConst, Ts > &  )
delete

◆ ValueProxy() [3/3]

template<bool IsConst, Serializable ... Ts>
Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::ValueProxy ( std::string_view  key,
HeaderType headers,
PatternType  inPattern = {} 
)

Member Function Documentation

◆ Get()

template<bool IsConst, Serializable ... Ts>
std::expected< Type, HeaderErrorEnum > Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Get ( ) &&

◆ GetAsOpt()

template<bool IsConst, Serializable ... Ts>
std::optional< Type > Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::GetAsOpt ( ) &&

◆ GetWithDefault()

template<bool IsConst, Serializable ... Ts>
std::expected< Type, InvalidHeaderFormat > Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::GetWithDefault ( Type  defaultValue) &&

◆ operator=() [1/2]

template<bool IsConst, Serializable ... Ts>
template<class T >
requires (!IsConst)
void Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::operator= ( const T &  newValue) &&

◆ operator=() [2/2]

template<bool IsConst, Serializable ... Ts>
template<class T >
requires (!IsConst)
void Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::operator= ( T &&  newValue) &&

◆ Set() [1/2]

template<bool IsConst, Serializable ... Ts>
template<class T >
requires (!IsConst)
void Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Set ( const T &  newValue) &&

◆ Set() [2/2]

template<bool IsConst, Serializable ... Ts>
template<class T >
requires (!IsConst)
void Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Set ( T &&  newValue) &&

◆ TrySet()

template<bool IsConst, Serializable ... Ts>
template<class = void>
requires (!IsConst)
bool Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::TrySet ( std::string_view  newValue) &&

Member Data Documentation

◆ Count

template<bool IsConst, Serializable ... Ts>
constexpr int Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Count { sizeof...(Ts) }
staticconstexpr

◆ Single

template<bool IsConst, Serializable ... Ts>
constexpr int Thoth::Http::NHeaders::ValueProxy< IsConst, Ts >::Single { sizeof...(Ts) == 1 }
staticconstexpr

The documentation for this struct was generated from the following files: