Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6jsontypes.h
Go to the documentation of this file.
1 
11 #ifndef P6JSONTYPES_H__
12 #define P6JSONTYPES_H__ 1
13 
14 #include "p6err.h"
15 
16 
17 #ifdef __cplusplus
18 namespace P6R {
19 extern "C" {
20 #endif
21 
32 typedef struct
33 {
34  const P6CHAR* pStart;
36 } P6JSONSTRING;
37 
38 
45 typedef enum {
46  P6JSON_TYPE_NULL = 0x00, // -> 'null' JSON value type
47  P6JSON_TYPE_STR = 0x01, // -> entire JSON string returned in once piece
48  P6JSON_TYPE_STRPART = 0x02, // -> part of a JSON string, entire string coming in chunks
49  P6JSON_TYPE_STREND = 0x03, // -> end of string which was returned in several chunks
50  P6JSON_TYPE_BOOL = 0x04, // -> 'true' | 'false' json values
51  P6JSON_TYPE_INTEGER = 0x05, // -> both positive and negative 32 bit numbers
52  P6JSON_TYPE_REAL = 0x06 // -> any number with a decimal point in it
53 } P6JSON_TYPE;
54 
55 
72 typedef struct
73 {
74  P6JSON_TYPE type; // which type is used?
75  P6JSONSTRING jstring; // offset into buffer where string was found
76  P6INT32 integer; // P6JSON_TYPE_INTEGER
77  P6FLOAT real; // P6JSON_TYPE_REAL
78  P6BOOL boolean; // P6JSON_TYPE_BOOL
79 } P6JSONVALUE;
80 
81 #ifdef __cplusplus
82 }
83 } // namespace
84 #endif
85 
86 
87 #endif
88 
89 
90 
91 
92 
93 
94 
uint32_t P6UINT32
Definition: p6types.h:77
P6JSON_TYPE type
Definition: p6jsontypes.h:74
Standard error codes.
The 'jstring' field is set for: { P6JSON_TYPE_STR, P6JSON_TYPE_STRPART, P6JSON_TYPE_STREND, P6JSON_TYPE_INTEGER, P6JSON_TYPE_REAL } jstring is set for numbers to allow an application to convert the string to another numeric variable type (e.g., P6UINT64 value).
Definition: p6jsontypes.h:72
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:133
P6JSON_TYPE
Used to indicate the type of a JSON expression being returned to a JSON content handler (see p6jsonco...
Definition: p6jsontypes.h:45
const P6CHAR * pStart
Definition: p6jsontypes.h:34
double P6FLOAT
Definition: p6types.h:93
To avoid having to copy strings or creating new strings we simply point into a set of buffers the sta...
Definition: p6jsontypes.h:32
P6JSONSTRING jstring
Definition: p6jsontypes.h:75
int32_t P6INT32
Definition: p6types.h:76
char P6CHAR
Narrow character type.
Definition: p6types.h:105