Instrument Neutral Distributed Interface INDI  1.9.5
Classes | Macros | Enumerations | Functions
gason.h File Reference
#include <cassert>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

union  JsonValue
 
struct  JsonNode
 
struct  JsonIterator
 
class  JsonAllocator
 

Macros

#define JSON_VALUE_PAYLOAD_MASK   0x00007FFFFFFFFFFFULL
 
#define JSON_VALUE_NAN_MASK   0x7FF8000000000000ULL
 
#define JSON_VALUE_TAG_MASK   0xF
 
#define JSON_VALUE_TAG_SHIFT   47
 
#define JSON_ERRNO_MAP(XX)
 
#define XX(no, str)   JSON_##no,
 

Enumerations

enum  JsonTag {
  JSON_NUMBER = 0, JSON_STRING, JSON_ARRAY, JSON_OBJECT,
  JSON_TRUE, JSON_FALSE, JSON_NULL = 0xF
}
 
enum  JsonErrno
 

Functions

JsonIterator begin (JsonValue o)
 
JsonIterator end (JsonValue)
 
const char * jsonStrError (int err)
 
int jsonParse (char *str, char **endptr, JsonValue *value, JsonAllocator &allocator)
 

Macro Definition Documentation

◆ JSON_ERRNO_MAP

#define JSON_ERRNO_MAP (   XX)
Value:
XX(OK, "ok") \
XX(BAD_NUMBER, "bad number") \
XX(BAD_STRING, "bad string") \
XX(BAD_IDENTIFIER, "bad identifier") \
XX(STACK_OVERFLOW, "stack overflow") \
XX(STACK_UNDERFLOW, "stack underflow") \
XX(MISMATCH_BRACKET, "mismatch bracket") \
XX(UNEXPECTED_CHARACTER, "unexpected character") \
XX(UNQUOTED_KEY, "unquoted key") \
XX(BREAKING_BAD, "breaking bad") \
XX(ALLOCATION_FAILURE, "allocation failure")

Definition at line 113 of file gason.h.

◆ JSON_VALUE_NAN_MASK

#define JSON_VALUE_NAN_MASK   0x7FF8000000000000ULL

Definition at line 44 of file gason.h.

◆ JSON_VALUE_PAYLOAD_MASK

#define JSON_VALUE_PAYLOAD_MASK   0x00007FFFFFFFFFFFULL

Definition at line 43 of file gason.h.

◆ JSON_VALUE_TAG_MASK

#define JSON_VALUE_TAG_MASK   0xF

Definition at line 45 of file gason.h.

◆ JSON_VALUE_TAG_SHIFT

#define JSON_VALUE_TAG_SHIFT   47

Definition at line 46 of file gason.h.

◆ XX

#define XX (   no,
  str 
)    JSON_##no,

Definition at line 128 of file gason.h.

Enumeration Type Documentation

◆ JsonErrno

enum JsonErrno

Definition at line 126 of file gason.h.

◆ JsonTag

enum JsonTag
Enumerator
JSON_NUMBER 
JSON_STRING 
JSON_ARRAY 
JSON_OBJECT 
JSON_TRUE 
JSON_FALSE 
JSON_NULL 

Definition at line 30 of file gason.h.

Function Documentation

◆ begin()

JsonIterator begin ( JsonValue  o)
inline

Definition at line 104 of file gason.h.

◆ end()

JsonIterator end ( JsonValue  )
inline

Definition at line 108 of file gason.h.

◆ jsonParse()

int jsonParse ( char *  str,
char **  endptr,
JsonValue value,
JsonAllocator allocator 
)

Definition at line 182 of file gason.cpp.

◆ jsonStrError()

const char* jsonStrError ( int  err)

Definition at line 31 of file gason.cpp.

XX
#define XX(no, str)
Definition: gason.h:128