Class

JsonGenerator

[]

Description [src]

class Json.Generator : GObject.Object
{
  /* No available fields */
}

JsonGenerator provides an object for generating a JSON data stream from a tree of JsonNode instances, and put it into a buffer or a file.

[]

Hierarchy

hierarchy this JsonGenerator ancestor_0 GObject ancestor_0--this
[]

Ancestors

[]

Constructors

json_generator_new

Creates a new JsonGenerator.

[]

Instance methods

json_generator_get_indent

Retrieves the value set using json_generator_set_indent().

since: 0.14

json_generator_get_indent_char

Retrieves the value set using json_generator_set_indent_char().

since: 0.14

json_generator_get_pretty

Retrieves the value set using json_generator_set_pretty().

since: 0.14

json_generator_get_root

Retrieves a pointer to the root node set using json_generator_set_root().

since: 0.14

json_generator_set_indent

Sets the number of repetitions for each indentation level.

since: 0.14

json_generator_set_indent_char

Sets the character to be used when indenting.

since: 0.14

json_generator_set_pretty

Sets whether the generated JSON should be pretty printed.

since: 0.14

json_generator_set_root

Sets the root of the JSON data stream to be serialized by the given generator.

json_generator_take_root

Sets the root of the JSON data stream to be serialized by the given generator.

since: 1.10

json_generator_to_data

Generates a JSON data stream from generator and returns it as a buffer.

json_generator_to_file

Creates a JSON data stream and puts it inside filename, overwriting the file’s current contents.

json_generator_to_gstring

Generates a JSON data stream and appends it to the string buffer.

since: 1.4

json_generator_to_stream

Outputs JSON data and writes it (synchronously) to the given stream.

since: 0.12

Methods inherited from GObject (43)
[]

Properties

Json.Generator:indent

Number of spaces to be used to indent when pretty printing.

Json.Generator:indent-char

The character that should be used when indenting in pretty print.

since: 0.6

Json.Generator:pretty

Whether the output should be “pretty-printed”, with indentation and newlines.

Json.Generator:root

The root node to be used when constructing a JSON data stream.

since: 0.4

[]

Signals

Signals inherited from GObject (1)

Class structure