CToon C++ 0.6.1
A C++ TOON/JSON serialization library
Loading...
Searching...
No Matches
ctoon::value Class Reference

#include <ctoon.hpp>

Public Member Functions

 value () CTOON_NOEXCEPT
 
 value (ctoon_val *v) CTOON_NOEXCEPT
 
ctoon_val * raw () const CTOON_NOEXCEPT
 
unsigned char valid () const CTOON_NOEXCEPT
 
 operator unsigned char () const CTOON_NOEXCEPT
 
unsigned char is_null () const CTOON_NOEXCEPT
 
unsigned char is_true () const CTOON_NOEXCEPT
 
unsigned char is_false () const CTOON_NOEXCEPT
 
unsigned char is_bool () const CTOON_NOEXCEPT
 
unsigned char is_uint () const CTOON_NOEXCEPT
 
unsigned char is_sint () const CTOON_NOEXCEPT
 
unsigned char is_int () const CTOON_NOEXCEPT
 
unsigned char is_real () const CTOON_NOEXCEPT
 
unsigned char is_num () const CTOON_NOEXCEPT
 
unsigned char is_str () const CTOON_NOEXCEPT
 
unsigned char is_arr () const CTOON_NOEXCEPT
 
unsigned char is_obj () const CTOON_NOEXCEPT
 
unsigned char get_bool () const CTOON_NOEXCEPT
 
std::uint64_t get_uint () const CTOON_NOEXCEPT
 
std::int64_t get_sint () const CTOON_NOEXCEPT
 
double get_real () const CTOON_NOEXCEPT
 
double get_num () const CTOON_NOEXCEPT
 
std::size_t get_len () const CTOON_NOEXCEPT
 
string_view get_str () const CTOON_NOEXCEPT
 
std::size_t arr_size () const CTOON_NOEXCEPT
 
value arr_get (std::size_t i) const CTOON_NOEXCEPT
 
value arr_first () const CTOON_NOEXCEPT
 
value arr_last () const CTOON_NOEXCEPT
 
value operator[] (std::size_t i) const CTOON_NOEXCEPT
 
std::size_t obj_size () const CTOON_NOEXCEPT
 
value obj_get (const char *key) const CTOON_NOEXCEPT
 
value obj_get (const string_view &key) const CTOON_NOEXCEPT
 
value operator[] (const char *key) const CTOON_NOEXCEPT
 
value operator[] (const string_view &key) const CTOON_NOEXCEPT
 
unsigned char equals (const value &rhs) const CTOON_NOEXCEPT
 
unsigned char equals (const char *s) const CTOON_NOEXCEPT
 
unsigned char equals (const string_view &s) const CTOON_NOEXCEPT
 
value get_pointer (const string_view &ptr) const CTOON_NOEXCEPT
 
write_result to_string (const write_options &opts=write_options()) const
 

Protected Attributes

ctoon_val * v_
 

Detailed Description

Definition at line 274 of file ctoon.hpp.

Constructor & Destructor Documentation

◆ value() [1/2]

ctoon::value::value ( )
inline

Definition at line 276 of file ctoon.hpp.

Referenced by arr_first(), arr_get(), arr_last(), get_pointer(), obj_get(), and obj_get().

◆ value() [2/2]

ctoon::value::value ( ctoon_val *  v)
inlineexplicit

Definition at line 277 of file ctoon.hpp.

Member Function Documentation

◆ arr_first()

value ctoon::value::arr_first ( ) const
inline

Definition at line 313 of file ctoon.hpp.

References v_, and value().

◆ arr_get()

value ctoon::value::arr_get ( std::size_t  i) const
inline

Definition at line 312 of file ctoon.hpp.

References v_, and value().

Referenced by operator[]().

◆ arr_last()

value ctoon::value::arr_last ( ) const
inline

Definition at line 314 of file ctoon.hpp.

References v_, and value().

◆ arr_size()

std::size_t ctoon::value::arr_size ( ) const
inline

Definition at line 311 of file ctoon.hpp.

References v_.

◆ equals() [1/3]

unsigned char ctoon::value::equals ( const char *  s) const
inline

Definition at line 328 of file ctoon.hpp.

References v_.

◆ equals() [2/3]

unsigned char ctoon::value::equals ( const string_view &  s) const
inline

Definition at line 329 of file ctoon.hpp.

References v_.

◆ equals() [3/3]

unsigned char ctoon::value::equals ( const value rhs) const
inline

Definition at line 327 of file ctoon.hpp.

References v_.

◆ get_bool()

unsigned char ctoon::value::get_bool ( ) const
inline

Definition at line 298 of file ctoon.hpp.

References v_.

◆ get_len()

std::size_t ctoon::value::get_len ( ) const
inline

Definition at line 303 of file ctoon.hpp.

References v_.

◆ get_num()

double ctoon::value::get_num ( ) const
inline

Definition at line 302 of file ctoon.hpp.

References v_.

◆ get_pointer()

value ctoon::value::get_pointer ( const string_view &  ptr) const
inline

Definition at line 332 of file ctoon.hpp.

References v_, and value().

◆ get_real()

double ctoon::value::get_real ( ) const
inline

Definition at line 301 of file ctoon.hpp.

References v_.

◆ get_sint()

std::int64_t ctoon::value::get_sint ( ) const
inline

Definition at line 300 of file ctoon.hpp.

References v_.

◆ get_str()

string_view ctoon::value::get_str ( ) const
inline

Definition at line 304 of file ctoon.hpp.

References v_.

◆ get_uint()

std::uint64_t ctoon::value::get_uint ( ) const
inline

Definition at line 299 of file ctoon.hpp.

References v_.

◆ is_arr()

unsigned char ctoon::value::is_arr ( ) const
inline

Definition at line 294 of file ctoon.hpp.

References v_.

◆ is_bool()

unsigned char ctoon::value::is_bool ( ) const
inline

Definition at line 287 of file ctoon.hpp.

References v_.

◆ is_false()

unsigned char ctoon::value::is_false ( ) const
inline

Definition at line 286 of file ctoon.hpp.

References v_.

◆ is_int()

unsigned char ctoon::value::is_int ( ) const
inline

Definition at line 290 of file ctoon.hpp.

References v_.

◆ is_null()

unsigned char ctoon::value::is_null ( ) const
inline

Definition at line 284 of file ctoon.hpp.

References v_.

◆ is_num()

unsigned char ctoon::value::is_num ( ) const
inline

Definition at line 292 of file ctoon.hpp.

References v_.

◆ is_obj()

unsigned char ctoon::value::is_obj ( ) const
inline

Definition at line 295 of file ctoon.hpp.

References v_.

◆ is_real()

unsigned char ctoon::value::is_real ( ) const
inline

Definition at line 291 of file ctoon.hpp.

References v_.

◆ is_sint()

unsigned char ctoon::value::is_sint ( ) const
inline

Definition at line 289 of file ctoon.hpp.

References v_.

◆ is_str()

unsigned char ctoon::value::is_str ( ) const
inline

Definition at line 293 of file ctoon.hpp.

References v_.

◆ is_true()

unsigned char ctoon::value::is_true ( ) const
inline

Definition at line 285 of file ctoon.hpp.

References v_.

◆ is_uint()

unsigned char ctoon::value::is_uint ( ) const
inline

Definition at line 288 of file ctoon.hpp.

References v_.

◆ obj_get() [1/2]

value ctoon::value::obj_get ( const char *  key) const
inline

Definition at line 319 of file ctoon.hpp.

References v_, and value().

Referenced by operator[](), and operator[]().

◆ obj_get() [2/2]

value ctoon::value::obj_get ( const string_view &  key) const
inline

Definition at line 320 of file ctoon.hpp.

References v_, and value().

◆ obj_size()

std::size_t ctoon::value::obj_size ( ) const
inline

Definition at line 318 of file ctoon.hpp.

References v_.

◆ operator unsigned char()

ctoon::value::operator unsigned char ( ) const
inline

Definition at line 281 of file ctoon.hpp.

References valid().

◆ operator[]() [1/3]

value ctoon::value::operator[] ( const char *  key) const
inline

Definition at line 323 of file ctoon.hpp.

References obj_get().

◆ operator[]() [2/3]

value ctoon::value::operator[] ( const string_view &  key) const
inline

Definition at line 324 of file ctoon.hpp.

References obj_get().

◆ operator[]() [3/3]

value ctoon::value::operator[] ( std::size_t  i) const
inline

Definition at line 315 of file ctoon.hpp.

References arr_get().

◆ raw()

ctoon_val * ctoon::value::raw ( ) const
inline

Definition at line 279 of file ctoon.hpp.

References v_.

Referenced by to_string().

◆ to_string()

write_result ctoon::value::to_string ( const write_options opts = write_options()) const
inline

Definition at line 337 of file ctoon.hpp.

References raw(), and v_.

◆ valid()

unsigned char ctoon::value::valid ( ) const
inline

Definition at line 280 of file ctoon.hpp.

References v_.

Referenced by operator unsigned char().

Member Data Documentation

◆ v_


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