FastLED 3.9.15
Loading...
Searching...
No Matches
fl::Json Class Reference

Detailed Description

Definition at line 1620 of file json.h.

#include <json.h>

+ Collaboration diagram for fl::Json:

Public Member Functions

 Json ()
 
 Json (bool b)
 
 Json (const char *s)
 
 Json (const fl::shared_ptr< JsonValue > &value)
 
 Json (const fl::string &s)
 
 Json (const fl::vector< float > &vec)
 
 Json (const Json &other)
 
 Json (double d)
 
 Json (fl::nullptr_t)
 
 Json (float f)
 
 Json (int i)
 
 Json (int64_t i)
 
 Json (JsonArray a)
 
 Json (JsonObject o)
 
template<typename T>
fl::optional< T > as () const
 
fl::optional< JsonArrayas_array () const
 
fl::optional< fl::vector< int16_t > > as_audio () const
 
fl::optional< bool > as_bool () const
 
fl::optional< fl::vector< uint8_t > > as_bytes () const
 
fl::optional< double > as_double () const
 
fl::optional< float > as_float () const
 
template<typename FloatType>
fl::optional< FloatType > as_float () const
 
fl::optional< fl::vector< float > > as_floats () const
 
fl::optional< int64_t > as_int () const
 
template<typename IntType>
fl::optional< IntType > as_int () const
 
fl::optional< JsonObjectas_object () const
 
template<typename T>
as_or (const T &fallback) const
 
fl::optional< fl::stringas_string () const
 
JsonValue::iterator begin ()
 
JsonValue::const_iterator begin () const
 
template<typename T>
JsonValue::template array_iterator< T > begin_array ()
 
template<typename T>
JsonValue::template array_iterator< T > begin_array () const
 
bool contains (const fl::string &key) const
 
bool contains (size_t idx) const
 
JsonValue::iterator end ()
 
JsonValue::const_iterator end () const
 
template<typename T>
JsonValue::template array_iterator< T > end_array ()
 
template<typename T>
JsonValue::template array_iterator< T > end_array () const
 
fl::vector< fl::stringgetObjectKeys () const
 
size_t getSize () const
 
bool has_value () const
 
bool is_array () const
 
bool is_audio () const
 
bool is_bool () const
 
bool is_bytes () const
 
bool is_double () const
 
bool is_float () const
 
bool is_floats () const
 
bool is_generic_array () const
 
bool is_int () const
 
bool is_null () const
 
bool is_object () const
 
bool is_string () const
 
fl::vector< fl::stringkeys () const
 
Jsonoperator= (bool value)
 
Jsonoperator= (const char *value)
 
Jsonoperator= (const fl::string &value)
 
Jsonoperator= (const Json &other)
 
Jsonoperator= (double value)
 
Jsonoperator= (fl::vector< float > vec)
 
Jsonoperator= (float value)
 
Jsonoperator= (int value)
 
Jsonoperator= (Json &&other)
 
Json operator[] (const fl::string &key)
 
const Json operator[] (const fl::string &key) const
 
Json operator[] (size_t idx)
 
const Json operator[] (size_t idx) const
 
template<typename T>
operator| (const T &fallback) const
 
void push_back (const Json &value)
 
fl::string serialize () const
 
void set (const fl::string &key, bool value)
 
void set (const fl::string &key, const char *value)
 
void set (const fl::string &key, const fl::string &value)
 
void set (const fl::string &key, const Json &value)
 
void set (const fl::string &key, double value)
 
void set (const fl::string &key, float value)
 
void set (const fl::string &key, int value)
 
void set (const fl::string &key, int64_t value)
 
template<typename T, typename = fl::enable_if_t<fl::is_same<T, char>::value>>
void set (const fl::string &key, T value)
 
void set_value (const fl::shared_ptr< JsonValue > &value)
 
size_t size () const
 
fl::string to_string () const
 
fl::string to_string_native () const
 
fl::string to_string_native_public () const
 
template<typename T>
fl::optional< T > try_as () const
 
template<typename T>
value () const
 

Static Public Member Functions

static Json array ()
 
static Json createArray ()
 
static Json createObject ()
 
static Json from_char (char c)
 
static Json from_value (const JsonValue &value)
 
static fl::string normalizeJsonString (const char *jsonStr)
 
static Json object ()
 
static Json parse (const fl::string &txt)
 

Private Member Functions

template<typename T>
fl::enable_if< fl::is_integral< T >::value &&!fl::is_same< T, bool >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, bool >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_floating_point< T >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::string >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, JsonArray >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, JsonObject >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< int16_t > >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< uint8_t > >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< float > >::value, fl::optional< T > >::type as_impl () const
 
template<typename T>
fl::enable_if< fl::is_integral< T >::value &&!fl::is_same< T, bool >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, bool >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_floating_point< T >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::string >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, JsonArray >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, JsonObject >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< int16_t > >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< uint8_t > >::value, T >::type get_default_value () const
 
template<typename T>
fl::enable_if< fl::is_same< T, fl::vector< float > >::value, T >::type get_default_value () const
 

Private Attributes

fl::shared_ptr< JsonValuem_value
 

Friends

JsonValue::const_iterator begin (const Json &j)
 
JsonValue::iterator begin (Json &j)
 
JsonValue::const_iterator end (const Json &j)
 
JsonValue::iterator end (Json &j)
 

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