![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cJSONWriter.h>
Static Public Member Functions | |
static HRESULT GRAYCALL | WriteVar (cStreamOutput *pOut, const cVariant &rVar, int iIndent=0) |
static HRESULT GRAYCALL | WriteVarToStr (OUT cJSONString &rsOut, const cVariant &rVar) |
![]() | |
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 Protected Member Functions | |
static HRESULT GRAYCALL | WriteIndent (cStreamOutput *pOut, int iIndent) |
static HRESULT GRAYCALL | WriteStr (cStreamOutput *pOut, cStringA s) |
static HRESULT GRAYCALL | WriteArray (cStreamOutput *pOut, const cVariantArray &rArray, int iIndent) |
static HRESULT GRAYCALL | WriteMap (cStreamOutput *pOut, const cVariantMap *pMap, int iIndent) |
Additional Inherited Members | |
![]() | |
enum | TYPE_TYPE { TYPE_Null , TYPE_Bool , TYPE_Double , TYPE_String } |
![]() | |
UNITTEST_FRIEND (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... | |
Write any given data type stored as cVariant to the string/stream/file in JSON format. cJSON::Encode() to Deal with encoding escape sequences.
|
staticprotected |
|
staticprotected |
proper tabs for indent.
|
staticprotected |
iterate through the map and write it.
|
staticprotected |
just use ESC encoded and quoted string. VARTYPE_TimeInt, VARTYPE_TimeDouble just use ESC encoded and quoted string.
|
static |
Write JSON text directly out to a cStreamOutput pOut.
|
static |
Put the contents of rVar into rsOut as a JSON string.