a class to store a generic JSON value as claim
More...
#include <jwt.h>
|
using | set_t = std::set<typename json_traits::string_type> |
|
|
| basic_claim (const basic_claim &)=default |
|
| basic_claim (basic_claim &&)=default |
|
basic_claim & | operator= (const basic_claim &)=default |
|
basic_claim & | operator= (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 |
| Get the contained JSON value as a date.
|
|
json_traits::array_type | as_array () const |
|
set_t | as_set () const |
|
json_traits::integer_type | as_integer () const |
|
json_traits::boolean_type | as_boolean () const |
|
json_traits::number_type | as_number () const |
|
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)
◆ set_t
template<typename json_traits >
using jwt::basic_claim< json_traits >::set_t = std::set<typename json_traits::string_type> |
◆ as_array()
template<typename json_traits >
Get the contained JSON value as an array
- Returns
- content as array
- Exceptions
-
std::bad_cast | Content was not an array |
◆ as_boolean()
template<typename json_traits >
Get the contained JSON value as a bool
- Returns
- content as bool
- Exceptions
-
std::bad_cast | Content was not a bool |
◆ as_date()
template<typename json_traits >
Get the contained JSON value as a date.
If the value is a decimal, it is rounded up to the closest integer
- Returns
- content as date
- Exceptions
-
std::bad_cast | Content was not a date |
◆ as_integer()
template<typename json_traits >
Get the contained JSON value as an integer
- Returns
- content as int
- Exceptions
-
std::bad_cast | Content was not an int |
◆ as_number()
template<typename json_traits >
Get the contained JSON value as a number
- Returns
- content as double
- Exceptions
-
std::bad_cast | Content was not a number |
◆ as_set()
template<typename json_traits >
Get the contained JSON value as a set of strings
- Returns
- content as set of strings
- Exceptions
-
std::bad_cast | Content was not an array of string |
◆ as_string()
template<typename json_traits >
Get the contained JSON value as a string
- Returns
- content as string
- Exceptions
-
std::bad_cast | Content was not a string |
◆ get_type()
template<typename json_traits >
Get type of contained JSON value
- Returns
- Type
- Exceptions
-
std::logic_error | An internal error occurred |
◆ operator<<()
template<typename json_traits >
Serialize claim to output stream from wrapped JSON value
- Returns
- output stream
◆ operator>>()
template<typename json_traits >
Parse input stream into underlying JSON value
- Returns
- input stream
◆ to_json()
template<typename json_traits >
Get wrapped JSON value
- Returns
- Wrapped JSON value
The documentation for this class was generated from the following file: