Goby3  3.1.5a
2024.05.23
jwt::basic_claim< json_traits > Class Template Reference

a class to store a generic JSON value as claim More...

#include <goby/util/thirdparty/jwt-cpp/jwt.h>

Public Types

using set_t = std::set< typename json_traits::string_type >
 

Public Member Functions

 basic_claim ()=default
 
 basic_claim (const basic_claim &)=default
 
 basic_claim (basic_claim &&)=default
 
basic_claimoperator= (const basic_claim &)=default
 
basic_claimoperator= (basic_claim &&)=default
 
 ~basic_claim ()=default
 
JWT_CLAIM_EXPLICIT basic_claim (typename json_traits::string_type s)
 
JWT_CLAIM_EXPLICIT basic_claim (const date &d)
 
JWT_CLAIM_EXPLICIT basic_claim (typename json_traits::array_type a)
 
JWT_CLAIM_EXPLICIT basic_claim (typename json_traits::value_type v)
 
JWT_CLAIM_EXPLICIT basic_claim (const set_t &s)
 
template<typename Iterator >
 basic_claim (Iterator begin, Iterator end)
 
json_traits::value_type to_json () const
 
std::istream & operator>> (std::istream &is)
 
std::ostream & operator<< (std::ostream &os)
 
json::type get_type () const
 
json_traits::string_type as_string () const
 
date as_date () const
 
json_traits::array_type as_array () const
 
set_t as_set () const
 
json_traits::integer_type as_int () const
 
json_traits::boolean_type as_bool () const
 
json_traits::number_type as_number () const
 

Detailed Description

template<typename json_traits>
class jwt::basic_claim< json_traits >

a class to store a generic JSON value as claim

Template Parameters
json_traits: JSON implementation traits
See also
RFC 7519: JSON Web Token (JWT)

Definition at line 2473 of file jwt.h.

Member Typedef Documentation

◆ set_t

template<typename json_traits >
using jwt::basic_claim< json_traits >::set_t = std::set<typename json_traits::string_type>

Definition at line 2497 of file jwt.h.

Constructor & Destructor Documentation

◆ basic_claim() [1/9]

template<typename json_traits >
jwt::basic_claim< json_traits >::basic_claim ( )
default

◆ basic_claim() [2/9]

template<typename json_traits >
jwt::basic_claim< json_traits >::basic_claim ( const basic_claim< json_traits > &  )
default

◆ basic_claim() [3/9]

template<typename json_traits >
jwt::basic_claim< json_traits >::basic_claim ( basic_claim< json_traits > &&  )
default

◆ ~basic_claim()

template<typename json_traits >
jwt::basic_claim< json_traits >::~basic_claim ( )
default

◆ basic_claim() [4/9]

template<typename json_traits >
JWT_CLAIM_EXPLICIT jwt::basic_claim< json_traits >::basic_claim ( typename json_traits::string_type  s)
inline

Definition at line 2506 of file jwt.h.

◆ basic_claim() [5/9]

template<typename json_traits >
JWT_CLAIM_EXPLICIT jwt::basic_claim< json_traits >::basic_claim ( const date d)
inline

Definition at line 2507 of file jwt.h.

◆ basic_claim() [6/9]

template<typename json_traits >
JWT_CLAIM_EXPLICIT jwt::basic_claim< json_traits >::basic_claim ( typename json_traits::array_type  a)
inline

Definition at line 2511 of file jwt.h.

◆ basic_claim() [7/9]

template<typename json_traits >
JWT_CLAIM_EXPLICIT jwt::basic_claim< json_traits >::basic_claim ( typename json_traits::value_type  v)
inline

Definition at line 2512 of file jwt.h.

◆ basic_claim() [8/9]

template<typename json_traits >
JWT_CLAIM_EXPLICIT jwt::basic_claim< json_traits >::basic_claim ( const set_t s)
inline

Definition at line 2513 of file jwt.h.

◆ basic_claim() [9/9]

template<typename json_traits >
template<typename Iterator >
jwt::basic_claim< json_traits >::basic_claim ( Iterator  begin,
Iterator  end 
)
inline

Definition at line 2518 of file jwt.h.

Member Function Documentation

◆ as_array()

template<typename json_traits >
json_traits::array_type jwt::basic_claim< json_traits >::as_array ( ) const
inline

Get the contained JSON value as an array

Returns
content as array
Exceptions
std::bad_castContent was not an array

Definition at line 2566 of file jwt.h.

◆ as_bool()

template<typename json_traits >
json_traits::boolean_type jwt::basic_claim< json_traits >::as_bool ( ) const
inline

Get the contained JSON value as a bool

Returns
content as bool
Exceptions
std::bad_castContent was not a bool

Definition at line 2592 of file jwt.h.

◆ as_date()

template<typename json_traits >
date jwt::basic_claim< json_traits >::as_date ( ) const
inline

Get the contained JSON value as a date

Returns
content as date
Exceptions
std::bad_castContent was not a date

Definition at line 2559 of file jwt.h.

◆ as_int()

template<typename json_traits >
json_traits::integer_type jwt::basic_claim< json_traits >::as_int ( ) const
inline

Get the contained JSON value as an integer

Returns
content as int
Exceptions
std::bad_castContent was not an int

Definition at line 2585 of file jwt.h.

◆ as_number()

template<typename json_traits >
json_traits::number_type jwt::basic_claim< json_traits >::as_number ( ) const
inline

Get the contained JSON value as a number

Returns
content as double
Exceptions
std::bad_castContent was not a number

Definition at line 2599 of file jwt.h.

◆ as_set()

template<typename json_traits >
set_t jwt::basic_claim< json_traits >::as_set ( ) const
inline

Get the contained JSON value as a set of strings

Returns
content as set of strings
Exceptions
std::bad_castContent was not an array of string

Definition at line 2573 of file jwt.h.

◆ as_string()

template<typename json_traits >
json_traits::string_type jwt::basic_claim< json_traits >::as_string ( ) const
inline

Get the contained JSON value as a string

Returns
content as string
Exceptions
std::bad_castContent was not a string

Definition at line 2552 of file jwt.h.

◆ get_type()

template<typename json_traits >
json::type jwt::basic_claim< json_traits >::get_type ( ) const
inline

Get type of contained JSON value

Returns
Type
Exceptions
std::logic_errorAn internal error occured

Definition at line 2545 of file jwt.h.

◆ operator<<()

template<typename json_traits >
std::ostream& jwt::basic_claim< json_traits >::operator<< ( std::ostream &  os)
inline

Serialize claim to output stream from wrapped JSON value

Returns
ouput stream

Definition at line 2538 of file jwt.h.

◆ operator=() [1/2]

template<typename json_traits >
basic_claim& jwt::basic_claim< json_traits >::operator= ( basic_claim< json_traits > &&  )
default

◆ operator=() [2/2]

template<typename json_traits >
basic_claim& jwt::basic_claim< json_traits >::operator= ( const basic_claim< json_traits > &  )
default

◆ operator>>()

template<typename json_traits >
std::istream& jwt::basic_claim< json_traits >::operator>> ( std::istream &  is)
inline

Parse input stream into underlying JSON value

Returns
input stream

Definition at line 2532 of file jwt.h.

◆ to_json()

template<typename json_traits >
json_traits::value_type jwt::basic_claim< json_traits >::to_json ( ) const
inline

Get wrapped JSON value

Returns
Wrapped JSON value

Definition at line 2526 of file jwt.h.


The documentation for this class was generated from the following file: