Class

JsonGenerator

since: 1.0

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.

Available since: 1.0

Hierarchy

hierarchy this JsonGenerator ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

json_generator_new

Creates a new JsonGenerator.

since: 1.0

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.

since: 1.0

json_generator_to_data

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

since: 1.0

json_generator_to_file

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

since: 1.0

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)

Please see GObject for a full list of methods.

Properties

Json.Generator:indent

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

since: 1.0

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.

since: 1.0

Json.Generator:root

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

since: 0.4

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

unstable since: 2.0

Class structure

struct JsonGeneratorClass {
  void (* _json_reserved1) (
void
  );
  void (* _json_reserved2) (
void
  );
  void (* _json_reserved3) (
void
  );
  void (* _json_reserved4) (
void
  );
  
}
No description available.
Class members
_json_reserved1: void (* _json_reserved1) ( void )
No description available.
_json_reserved2: void (* _json_reserved2) ( void )
No description available.
_json_reserved3: void (* _json_reserved3) ( void )
No description available.
_json_reserved4: void (* _json_reserved4) ( void )
No description available.