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

JSON base object. More...

Data Fields

void(* ToString )(const CMUTIL_Json *json, CMUTIL_String *buf, CMBool pretty)
 Convert the JSON object to a string representation.
 
CMJsonType(* GetType )(const CMUTIL_Json *json)
 Get the type of the JSON object.
 
CMUTIL_Json *(* Clone )(const CMUTIL_Json *json)
 Clone the JSON object.
 
void(* Destroy )(CMUTIL_Json *json)
 Destroy the JSON object.
 

Detailed Description

JSON base object.

Field Documentation

◆ ToString

void(* CMUTIL_Json::ToString) (const CMUTIL_Json *json, CMUTIL_String *buf, CMBool pretty)

Convert the JSON object to a string representation.

This method serializes the JSON object into a string format. If 'pretty' is CMTrue, the output will be formatted with indentation and line breaks for better readability.

Parameters
jsonThe JSON object to be converted.
bufThe string buffer to store the resulting string.
prettyIf CMTrue, the output will be pretty-printed.

◆ GetType

CMJsonType(* CMUTIL_Json::GetType) (const CMUTIL_Json *json)

Get the type of the JSON object.

This method retrieves the type of the JSON object, which can be one of the following: CMJsonTypeValue, CMJsonTypeObject, or CMJsonTypeArray.

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

◆ Clone

CMUTIL_Json *(* CMUTIL_Json::Clone) (const CMUTIL_Json *json)

Clone the JSON object.

This method creates a deep copy of the JSON object.

Parameters
jsonThe JSON object to be cloned.
Returns
A new JSON object that is a clone of the original.

◆ Destroy

void(* CMUTIL_Json::Destroy) (CMUTIL_Json *json)

Destroy the JSON object.

This method releases all resources associated with the JSON object and frees any allocated memory.

Parameters
jsonA pointer to the CMUTIL_Json object to be destroyed.

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