Fwupd.JsonParser

g Fwupd.JsonParser Fwupd.JsonParser GObject.Object GObject.Object GObject.Object->Fwupd.JsonParser

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

set_max_depth (max_depth)

set_max_items (max_items)

set_max_quoted (max_quoted)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Fwupd.JsonParser(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fwupd.JsonParserClass

A streaming tokenizer JSON parser that is resistant to malicious input.

One item of note is that most of the JSON string methods actually return a #GRefString – which can be used to avoid lots of tiny memory allocation when parsing JSON into other objects.

See also: ‘struct@FwupdJsonArray [struct@FwupdJsonObject]’ [struct`FwupdJsonNode`]

classmethod new()[source]
Returns:

a Fwupd.JsonParser

Return type:

Fwupd.JsonParser

New in version 2.1.1.

set_max_depth(max_depth)[source]
Parameters:

max_depth (int) – max nesting depth

Sets the maximum nesting depth.

The default maximum depth is GObject.G_MAXUINT16, but users of Fwupd.JsonParser should use this function to set a better limit.

New in version 2.1.1.

set_max_items(max_items)[source]
Parameters:

max_items (int) – max items

Sets the maximum number of items in an array or object.

The default maximum items is GObject.G_MAXUINT16, but users of Fwupd.JsonParser should use this function to set a better limit.

New in version 2.1.1.

set_max_quoted(max_quoted)[source]
Parameters:

max_quoted (int) – maximum size of a quoted string

Sets the maximum size of a quoted string.

The default maximum quoted string length is GObject.G_MAXUINT16, but users of Fwupd.JsonParser should use this function to set a better limit.

New in version 2.1.1.