libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_JsonValue Struct Reference

JSON value object. More...

Data Fields

CMUTIL_Json parent
 
CMJsonValueType(* GetValueType )(const CMUTIL_JsonValue *jval)
 Get the type of the JSON value.
 
int64_t(* GetLong )(const CMUTIL_JsonValue *jval)
 Get the long integer value from the JSON value.
 
double(* GetDouble )(const CMUTIL_JsonValue *jval)
 Get the double value from the JSON value.
 
const CMUTIL_String *(* GetString )(const CMUTIL_JsonValue *jval)
 Get the string value from the JSON value.
 
const char *(* GetCString )(const CMUTIL_JsonValue *jval)
 Get the C-style string value from the JSON value.
 
CMBool(* GetBoolean )(const CMUTIL_JsonValue *jval)
 Get the boolean value from the JSON value.
 
void(* SetLong )(CMUTIL_JsonValue *jval, int64_t inval)
 Set the long integer value of the JSON value.
 
void(* SetDouble )(CMUTIL_JsonValue *jval, double inval)
 Set the double value of the JSON value.
 
void(* SetString )(CMUTIL_JsonValue *jval, const char *inval)
 Set the string value of the JSON value.
 
void(* SetBoolean )(CMUTIL_JsonValue *jval, CMBool inval)
 Set the boolean value of the JSON value.
 
void(* SetNull )(CMUTIL_JsonValue *jval)
 Set the JSON value to null.
 

Detailed Description

JSON value object.

Must be destroyed with CMUTIL_JsonDestroy.

Field Documentation

◆ parent

CMUTIL_Json CMUTIL_JsonValue::parent

JSON base object.

◆ GetValueType

CMJsonValueType(* CMUTIL_JsonValue::GetValueType) (const CMUTIL_JsonValue *jval)

Get the type of the JSON value.

This method retrieves the type of the JSON value, which can be one of the following: CMJsonValueLong, CMJsonValueDouble, CMJsonValueString, CMJsonValueBoolean, or CMJsonValueNull.

Parameters
jvalThe JSON value object to get the type from.
Returns
The type of the JSON value.

◆ GetLong

int64_t(* CMUTIL_JsonValue::GetLong) (const CMUTIL_JsonValue *jval)

Get the long integer value from the JSON value.

This method retrieves the long integer value stored in the JSON value object.

Parameters
jvalThe JSON value object to get the long integer from.
Returns
The long integer value.

◆ GetDouble

double(* CMUTIL_JsonValue::GetDouble) (const CMUTIL_JsonValue *jval)

Get the double value from the JSON value.

This method retrieves the double value stored in the JSON value object.

Parameters
jvalThe JSON value object to get the double from.
Returns
The double value.

◆ GetString

const CMUTIL_String *(* CMUTIL_JsonValue::GetString) (const CMUTIL_JsonValue *jval)

Get the string value from the JSON value.

This method retrieves the string value stored in the JSON value object.

Parameters
jvalThe JSON value object to get the string from.
Returns
A pointer to the CMUTIL_String containing the string value.

◆ GetCString

const char *(* CMUTIL_JsonValue::GetCString) (const CMUTIL_JsonValue *jval)

Get the C-style string value from the JSON value.

This method retrieves the C-style string value stored in the JSON value object.

Parameters
jvalThe JSON value object to get the C-style string from.
Returns
A pointer to the C-style string.

◆ GetBoolean

CMBool(* CMUTIL_JsonValue::GetBoolean) (const CMUTIL_JsonValue *jval)

Get the boolean value from the JSON value.

This method retrieves the boolean value stored in the JSON value object.

Parameters
jvalThe JSON value object to get the boolean from.
Returns
The boolean value.

◆ SetLong

void(* CMUTIL_JsonValue::SetLong) (CMUTIL_JsonValue *jval, int64_t inval)

Set the long integer value of the JSON value.

This method sets the long integer value of the JSON value object.

Parameters
jvalThe JSON value object to set the long integer for.
invalThe long integer value to set.

◆ SetDouble

void(* CMUTIL_JsonValue::SetDouble) (CMUTIL_JsonValue *jval, double inval)

Set the double value of the JSON value.

This method sets the double value of the JSON value object.

Parameters
jvalThe JSON value object to set the double for.
invalThe double value to set.

◆ SetString

void(* CMUTIL_JsonValue::SetString) (CMUTIL_JsonValue *jval, const char *inval)

Set the string value of the JSON value.

This method sets the string value of the JSON value object.

Parameters
jvalThe JSON value object to set the string for.
invalThe string value to set.

◆ SetBoolean

void(* CMUTIL_JsonValue::SetBoolean) (CMUTIL_JsonValue *jval, CMBool inval)

Set the boolean value of the JSON value.

This method sets the boolean value of the JSON value object.

Parameters
jvalThe JSON value object to set the boolean for.
invalThe boolean value to set.

◆ SetNull

void(* CMUTIL_JsonValue::SetNull) (CMUTIL_JsonValue *jval)

Set the JSON value to null.

This method sets the JSON value object to represent a null value.

Parameters
jvalThe JSON value object to set to null.

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