Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cJSONReadVariant Class Reference

#include <cJSONReader.h>

Inheritance diagram for GrayLib::cJSONReadVariant:
GrayLib::cJSONReadVisitor GrayLib::cJSON

Public Member Functions

 cJSONReadVariant (cVariant &v)
 
cVariantget_V ()
 
virtual void SetNull () override
 
virtual void SetBool (bool bVal) override
 
virtual void SetDouble (double dVal) override
 
virtual void SetString (const char *pszString, StrLen_t nLen) override
 
virtual void SetArray () override
 
virtual void SetMap () override
 
virtual void * MakeArrayElement (cJSONReader &r, ITERATE_t i) override
 
virtual void * MakeMapElement (cJSONReader &r, const char *pszTag) override
 
- Public Member Functions inherited from GrayLib::cJSONReadVisitor
 cJSONReadVisitor (void *pVal)
 
- Public Member Functions inherited from GrayLib::cJSON
 UNITTEST_FRIEND (cJSON)
 

Additional Inherited Members

- Public Types inherited from GrayLib::cJSON
enum  TYPE_TYPE { TYPE_Null , TYPE_Bool , TYPE_Double , TYPE_String }
 
- Static Public Member Functions inherited from GrayLib::cJSON
static bool GRAYCALL IsJSON (const char *pszStr, StrLen_t iLenMax=StrT::k_LEN_MAX)
 
static cVariant GRAYCALL Parse (const char *pszVal)
 
static cJSONString GRAYCALL Encode (const cVariant &v)
 
- Public Attributes inherited from GrayLib::cJSONReadVisitor
void * m_pVal
 Fill this target variant with the contents of the JSON. More...
 
- Static Public Attributes inherited from GrayLib::cJSON
static const char k_null [5] = "null"
 "null" is valid syntax. More...
 
static const char k_true [5] = "true"
 "true" More...
 
static const char k_false [6] = "false"
 "false" More...
 
static const int k_DEPTH_MAX = 50
 Arbitrary max depth of read recursion. More...
 

Detailed Description

Implement cJSONReadVisitor for a cVariant target.

Constructor & Destructor Documentation

◆ cJSONReadVariant()

GrayLib::cJSONReadVariant::cJSONReadVariant ( cVariant v)

Member Function Documentation

◆ get_V()

cVariant& GrayLib::cJSONReadVariant::get_V ( )
inline

m_pVal always represents a cVariant.

◆ MakeArrayElement()

void * GrayLib::cJSONReadVariant::MakeArrayElement ( cJSONReader r,
ITERATE_t  i 
)
overridevirtual

Add Array element. Assume SetArray() was already called.

Returns
nullptr = cancel

Implements GrayLib::cJSONReadVisitor.

◆ MakeMapElement()

void * GrayLib::cJSONReadVariant::MakeMapElement ( cJSONReader r,
const char *  pszTag 
)
overridevirtual

Add Map element. Assume SetMap() was already called. pszTag MUST be unique and new? @pszTag = fail if the name is not valid ???

Returns
nullptr = cancel

Implements GrayLib::cJSONReadVisitor.

◆ SetArray()

void GrayLib::cJSONReadVariant::SetArray ( )
overridevirtual

◆ SetBool()

void GrayLib::cJSONReadVariant::SetBool ( bool  bVal)
overridevirtual

◆ SetDouble()

void GrayLib::cJSONReadVariant::SetDouble ( double  dVal)
overridevirtual

◆ SetMap()

void GrayLib::cJSONReadVariant::SetMap ( )
overridevirtual

◆ SetNull()

void GrayLib::cJSONReadVariant::SetNull ( )
overridevirtual

◆ SetString()

void GrayLib::cJSONReadVariant::SetString ( const char *  pszString,
StrLen_t  nLen 
)
overridevirtual

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