Gateway C ABI
Loading...
Searching...
No Matches
sGCJsonCallbacks Struct Reference

The JSON configuration data and parsing callbacks. More...

#include <json.h>

Data Fields

tJsonObjectGetBool getBool
 Parse a boolean from a JSON object.
 
tJsonObjectGetInt getInt
 Parse an integer from a JSON object.
 
tJsonObjectGetDouble getDouble
 Parse a double from a JSON object.
 
tJsonObjectGetString getString
 Parse a string from a JSON object.
 
tJsonObjectGetArrayIdx getArrayIdx
 Get an element from a JSON array.
 
tJsonObjectGetArrayLength getArrayLength
 Get the length of a JSON array.
 
tJsonObjectGetObjectField getObjectField
 Get a field from a JSON object.
 
tJsonObjectSerialize getObjectSerialized
 Serialize a JSON object to a string.
 
tFreeSring freeString
 Free a string.
 
const GCJsonObject data
 The plugin specific configuration.
 

Detailed Description

The JSON configuration data and parsing callbacks.

This struct holds the JSON configuration data and the parsing callbacks that the plugin can use to parse the configuration.

Field Documentation

◆ data

const GCJsonObject sGCJsonCallbacks::data

The plugin specific configuration.

Represents the top level JSON object that contains the plugin specific configuration set by the user.

◆ freeString

tFreeSring sGCJsonCallbacks::freeString

Free a string.

Free a string returned by getString or getObjectSerialized.

Parameters
strThe string to free

◆ getArrayIdx

tJsonObjectGetArrayIdx sGCJsonCallbacks::getArrayIdx

Get an element from a JSON array.

Parameters
objThe JSON object
idxThe index of the element to get
resultThe result of the operation
Returns
The element at the specified index or NULL if an error occurred

◆ getArrayLength

tJsonObjectGetArrayLength sGCJsonCallbacks::getArrayLength

Get the length of a JSON array.

Parameters
objThe JSON object
resultThe result of the operation
Returns
The length of the array or -1 if an error occurred

◆ getBool

tJsonObjectGetBool sGCJsonCallbacks::getBool

Parse a boolean from a JSON object.

Parameters
objThe JSON object
resultThe result of the operation

◆ getDouble

tJsonObjectGetDouble sGCJsonCallbacks::getDouble

Parse a double from a JSON object.

Parameters
objThe JSON object
resultThe result of the operation

◆ getInt

tJsonObjectGetInt sGCJsonCallbacks::getInt

Parse an integer from a JSON object.

Parameters
objThe JSON object
resultThe result of the operation

◆ getObjectField

tJsonObjectGetObjectField sGCJsonCallbacks::getObjectField

Get a field from a JSON object.

Parameters
objThe JSON object
fieldNameThe name of the field to get
resultThe result of the operation
Returns
The field or NULL if an error occurred

◆ getObjectSerialized

tJsonObjectSerialize sGCJsonCallbacks::getObjectSerialized

Serialize a JSON object to a string.

Parameters
objThe JSON object
resultThe result of the operation
Returns
The serialized JSON object or NULL if an error occurred
Note
The plugin must call freeString on the returned string if it is not null. Not doing so will result in a memory leak.

◆ getString

tJsonObjectGetString sGCJsonCallbacks::getString

Parse a string from a JSON object.

Parameters
objThe JSON object
resultThe result of the operation
Returns
The string parsed from the JSON object or NULL if an error occurred
Note
The plugin must call freeString on the returned string if it is not null. Not doing so will result in a memory leak.

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