Detailed Description
JSON methods.
Introduction
Contains common methods to create JSON documents, add properties, add either single or list values to properties. String values are escaped to comply with the JSON specification.
Data Structures
A single data structure is used with members for a) the output buffer, and b) the reference data.
The output buffer is represented as a pointer and a length. An additional member is used to record the number of characters that would be needed to complete the creation of a valid JSON response. This can be used by the caller to increase the buffer size if not big enough and call the related methods a subsequent time.
Reference data for the property being added, the values being added, and a collection of strings is also provided.
Collaboration diagram for JSON:
Structs | |
| struct | fiftyoneDegreesJson |
| Structure used to populated a JSON string for all required properties and values. More... | |
Functions | |
| void | fiftyoneDegreesJsonDocumentStart (fiftyoneDegreesJson *json) |
| Writes the start of the JSON document characters to the buffer in json. | |
| void | fiftyoneDegreesJsonDocumentEnd (fiftyoneDegreesJson *json) |
| Writes the end of the JSON document characters to the buffer in json. | |
| void | fiftyoneDegreesJsonPropertyStart (fiftyoneDegreesJson *json) |
| Writes the start of the property in json->property to the buffer in json. | |
| void | fiftyoneDegreesJsonPropertyEnd (fiftyoneDegreesJson *json) |
| Writes the end of the property in json->property to the buffer in json. | |
| void | fiftyoneDegreesJsonPropertyValues (fiftyoneDegreesJson *json) |
| Writes the values in the json->values list to the buffer in json. | |
| void | fiftyoneDegreesJsonPropertySeparator (fiftyoneDegreesJson *json) |
| Writes the a property separator to the buffer in json. | |
Function Documentation
◆ fiftyoneDegreesJsonDocumentEnd()
| void fiftyoneDegreesJsonDocumentEnd | ( | fiftyoneDegreesJson * | json | ) |
Writes the end of the JSON document characters to the buffer in json.
- Parameters
-
json data structure
◆ fiftyoneDegreesJsonDocumentStart()
| void fiftyoneDegreesJsonDocumentStart | ( | fiftyoneDegreesJson * | json | ) |
Writes the start of the JSON document characters to the buffer in json.
- Parameters
-
json data structure
◆ fiftyoneDegreesJsonPropertyEnd()
| void fiftyoneDegreesJsonPropertyEnd | ( | fiftyoneDegreesJson * | json | ) |
Writes the end of the property in json->property to the buffer in json.
- Parameters
-
json data structure
◆ fiftyoneDegreesJsonPropertySeparator()
| void fiftyoneDegreesJsonPropertySeparator | ( | fiftyoneDegreesJson * | json | ) |
Writes the a property separator to the buffer in json.
- Parameters
-
json data structure
◆ fiftyoneDegreesJsonPropertyStart()
| void fiftyoneDegreesJsonPropertyStart | ( | fiftyoneDegreesJson * | json | ) |
Writes the start of the property in json->property to the buffer in json.
- Parameters
-
json data structure
◆ fiftyoneDegreesJsonPropertyValues()
| void fiftyoneDegreesJsonPropertyValues | ( | fiftyoneDegreesJson * | json | ) |
Writes the values in the json->values list to the buffer in json.
- Parameters
-
json data structure
