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

#include <cJSON.h>

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

Public Types

enum  TYPE_TYPE { TYPE_Null , TYPE_Bool , TYPE_Double , TYPE_String }
 

Public Member Functions

 UNITTEST_FRIEND (cJSON)
 

Static Public Member Functions

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)
 

Static Public Attributes

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

Shared functions for reading and writing JSON format data. A serialized JSON object can be stored in cVariant http://json.org/example.html

Member Enumeration Documentation

◆ TYPE_TYPE

Enumerator
TYPE_Null 
TYPE_Bool 
TYPE_Double 
TYPE_String 

Member Function Documentation

◆ Encode()

cJSONString GRAYCALL GrayLib::cJSON::Encode ( const cVariant v)
static

Encode a cVariant as a JSON string.

◆ IsJSON()

bool GRAYCALL GrayLib::cJSON::IsJSON ( const char *  pszStr,
StrLen_t  iLenMax = StrT::k_LEN_MAX 
)
static

Does this look like JSON vs. some other format like XML ? Assume skipped whitespace.

◆ Parse()

cVariant GRAYCALL GrayLib::cJSON::Parse ( const char *  pszVal)
static

parse string in JSON format to a variant.

Returns
HRESULT if it failed.

◆ UNITTEST_FRIEND()

GrayLib::cJSON::UNITTEST_FRIEND ( cJSON  )

Member Data Documentation

◆ k_DEPTH_MAX

const int GrayLib::cJSON::k_DEPTH_MAX = 50
static

Arbitrary max depth of read recursion.

◆ k_false

const char GrayLib::cJSON::k_false = "false"
static

"false"

◆ k_null

const char GrayLib::cJSON::k_null = "null"
static

"null" is valid syntax.

◆ k_true

const char GrayLib::cJSON::k_true = "true"
static

"true"


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