|
Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <assert.h>#include <stdlib.h>#include <string.h>#include "Boole.h"#include "JSONSerialization.h"#include "MutableData.h"#include "MutableDictionary.h"#include "MutableArray.h"#include "Null.h"#include "Number.h"Go to the source code of this file.
Data Structures | |
| struct | JSONReader |
| A reader for parsing JSON Data. More... | |
| struct | JSONWriter |
| A writer for generating JSON Data. More... | |
Macros | |
| #define | _Class _JSONSerialization |
Functions | |
| Class * | _JSONSerialization (void) |
| static void | consumeBytes (JSONReader *reader, const char *bytes) |
Consumes and verifies bytes from `reader. More... | |
| static Data * | dataFromObject (const ident obj, int options) |
| static void | initialize (Class *clazz) |
| static ident | objectFromData (const Data *data, int options) |
| static Array * | readArray (JSONReader *reader) |
| Reads an array from `reader. More... | |
| static _Bool * | readBoole (JSONReader *reader) |
Reads a Boole from reader. More... | |
| static int | readByte (JSONReader *reader) |
| static int | readByteUntil (JSONReader *reader, const char *stop) |
Consume bytes from reader until a byte from stop is found. More... | |
| static ident | readElement (JSONReader *reader) |
Reads an element from reader. An element is any valid JSON type. More... | |
| static String * | readLabel (JSONReader *reader) |
Reads a label from reader. More... | |
| static Null * | readNull (JSONReader *reader) |
Reads Null from Reader. More... | |
| static Number * | readNumber (JSONReader *reader) |
Reads a Number from reader. More... | |
| static Dictionary * | readObject (JSONReader *reader) |
Reads an object from reader. An object is a valid JSON structure. More... | |
| static String * | readString (JSONReader *reader) |
Reads a String from reader. More... | |
| static void | writeArray (JSONWriter *writer, const Array *array) |
Writes array to writer. More... | |
| static void | writeBoole (JSONWriter *writer, const Boole *boolean) |
Writes boolean to writer. More... | |
| static void | writeElement (JSONWriter *writer, const ident obj) |
Writes the specified JSON element to writer. More... | |
| static void | writeLabel (JSONWriter *writer, const String *label) |
Writes the label (field name) label to writer. More... | |
| static void | writeNull (JSONWriter *writer, const Null *null) |
Writes null to writer. More... | |
| static void | writeNumber (JSONWriter *writer, const Number *number) |
Writes number to writer. More... | |
| static void | writeObject (JSONWriter *writer, const Dictionary *object) |
Writes object to writer. More... | |
| static void | writePretty (JSONWriter *writer) |
Writes pretty formatting, if applicable, to writer. More... | |
| static void | writeString (JSONWriter *writer, const String *string) |
Writes string to writer. More... | |
| #define _Class _JSONSerialization |
Definition at line 37 of file JSONSerialization.c.
| Class * _JSONSerialization | ( | void | ) |
Definition at line 511 of file JSONSerialization.c.
|
static |
Consumes and verifies bytes from `reader.
| reader | The JSONReader. |
| bytes | The bytes to consume from reader. |
Definition at line 294 of file JSONSerialization.c.
Definition at line 223 of file JSONSerialization.c.
|
static |
Definition at line 501 of file JSONSerialization.c.
Definition at line 482 of file JSONSerialization.c.
|
static |
Reads an array from `reader.
| reader | The JSONReader. |
Definition at line 430 of file JSONSerialization.c.
|
static |
Reads a Boole from reader.
| reader | The JSONReader. |
Definition at line 341 of file JSONSerialization.c.
|
static |
| reader | The JSONReader. |
reader, or -1 if reader is exhausted. Definition at line 254 of file JSONSerialization.c.
|
static |
Consume bytes from reader until a byte from stop is found.
| reader | The JSONReader. |
| stop | A sequence of stop characters. |
stop byte found, or -1 if reader is exhausted. Definition at line 275 of file JSONSerialization.c.
|
static |
Reads an element from reader. An element is any valid JSON type.
| reader | The JSONReader. |
NULL if no element is available. Definition at line 456 of file JSONSerialization.c.
|
static |
Reads a label from reader.
| reader | The JSONReader. |
NULL on error. Definition at line 380 of file JSONSerialization.c.
|
static |
Reads Null from Reader.
| reader | The JSONReader. |
Definition at line 366 of file JSONSerialization.c.
|
static |
Reads a Number from reader.
| reader | The JSONReader. |
Definition at line 323 of file JSONSerialization.c.
|
static |
Reads an object from reader. An object is a valid JSON structure.
| reader | The JSONReader. |
Definition at line 397 of file JSONSerialization.c.
|
static |
Reads a String from reader.
| reader | The JSONReader. |
Definition at line 307 of file JSONSerialization.c.
|
static |
Writes array to writer.
| writer | The JSONWriter. |
| array | The Array to write. |
Definition at line 172 of file JSONSerialization.c.
|
static |
Writes boolean to writer.
| writer | The JSONWriter. |
| boolean | The Boole to write. |
Definition at line 67 of file JSONSerialization.c.
|
static |
Writes the specified JSON element to writer.
| writer | The JSONWriter. |
| obj | The JSON element to write. |
Definition at line 199 of file JSONSerialization.c.
|
static |
Writes the label (field name) label to writer.
| writer | The JSONWriter. |
| label | The label to write. |
Definition at line 107 of file JSONSerialization.c.
|
static |
Writes null to writer.
| writer | The JSONWriter. |
| null | The Null to write. |
Definition at line 57 of file JSONSerialization.c.
|
static |
Writes number to writer.
| writer | The JSONWriter. |
| number | The Number to write. |
Definition at line 93 of file JSONSerialization.c.
|
static |
Writes object to writer.
| writer | The JSONWriter. |
| object | The object (Dictionary) to write. |
Definition at line 132 of file JSONSerialization.c.
|
static |
Writes pretty formatting, if applicable, to writer.
| writer | The JSONWriter. |
Definition at line 117 of file JSONSerialization.c.
|
static |
Writes string to writer.
| writer | The JSONWriter. |
| string | The String to write. |
Definition at line 81 of file JSONSerialization.c.