Fwupd.Codec

g Fwupd.Codec Fwupd.Codec GObject.GInterface GObject.GInterface GObject.GInterface->Fwupd.Codec

Implementations:

Fwupd.BiosSetting, Fwupd.Device, Fwupd.Plugin, Fwupd.Release, Fwupd.Remote, Fwupd.Report, Fwupd.Request, Fwupd.SecurityAttr

Methods

class

array_from_variant (value, gtype)

class

array_to_json (array, member_name, builder, flags)

class

array_to_variant (array, flags)

class

json_append (builder, key, value)

class

json_append_bool (builder, key, value)

class

json_append_int (builder, key, value)

class

json_append_strv (builder, key, value)

class

string_append (str, idt, key, value)

class

string_append_bool (str, idt, key, value)

class

string_append_hex (str, idt, key, value)

class

string_append_int (str, idt, key, value)

class

string_append_size (str, idt, key, value)

class

string_append_time (str, idt, key, value)

add_string (idt, str)

from_json (json_node)

from_json_string (json)

from_variant (value)

to_json (builder, flags)

to_json_string (flags)

to_string ()

to_variant (flags)

Virtual Methods

do_add_json (builder, flags)

do_add_string (idt, str)

do_add_variant (builder, flags)

do_from_json (json_node)

do_from_variant (value)

do_to_string ()

do_to_variant (flags)

Properties

None

Signals

None

Fields

None

Class Details

class Fwupd.Codec
Bases:

GObject.GInterface

Structure:

Fwupd.CodecInterface

A codec that can serialize and deserialize objects to formats such as text, JSON or GLib.Variant.

classmethod array_from_variant(value, gtype)[source]
Parameters:
Raises:

GLib.Error

Returns:

True on success

Return type:

[GObject.Object]

Converts an array of objects, each deserialized from a GLib.Variant value.

New in version 2.0.0.

classmethod array_to_json(array, member_name, builder, flags)[source]
Parameters:

Converts an array of objects into a GLib.Variant value.

New in version 2.0.0.

classmethod array_to_variant(array, flags)[source]
Parameters:
Returns:

a GLib.Variant

Return type:

GLib.Variant

Converts an array of objects into a GLib.Variant value.

New in version 2.0.0.

classmethod json_append(builder, key, value)[source]
Parameters:

Appends a key and value to a JSON builder.

New in version 2.0.0.

classmethod json_append_bool(builder, key, value)[source]
Parameters:

Appends a key and boolean value to a JSON builder.

New in version 2.0.0.

classmethod json_append_int(builder, key, value)[source]
Parameters:

Appends a key and unsigned integer to a JSON builder.

New in version 2.0.0.

classmethod json_append_strv(builder, key, value)[source]
Parameters:

Appends a key and string array to a JSON builder.

New in version 2.0.0.

classmethod string_append(str, idt, key, value)[source]
Parameters:

Appends a key and value to a string.

New in version 2.0.0.

classmethod string_append_bool(str, idt, key, value)[source]
Parameters:

Appends a key and boolean value to a string.

New in version 2.0.0.

classmethod string_append_hex(str, idt, key, value)[source]
Parameters:

Appends a key and hex integer to a string.

New in version 2.0.0.

classmethod string_append_int(str, idt, key, value)[source]
Parameters:

Appends a key and unsigned integer to a string.

New in version 2.0.0.

classmethod string_append_size(str, idt, key, value)[source]
Parameters:

Appends a key and size in bytes to a string.

New in version 2.0.0.

classmethod string_append_time(str, idt, key, value)[source]
Parameters:

Appends a key and time value to a string.

New in version 2.0.0.

add_string(idt, str)[source]
Parameters:
  • idt (int) – the indent

  • str (GLib.String) – a string to append to

Converts an object that implements Fwupd.Codec to a debug string, appending it to str.

New in version 2.0.0.

from_json(json_node)[source]
Parameters:

json_node (Json.Node) – a JSON node

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Converts an object that implements Fwupd.Codec from a JSON object.

New in version 2.0.0.

from_json_string(json)[source]
Parameters:

json (str) – JSON text

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Converts an object that implements Fwupd.Codec from a JSON string.

New in version 2.0.0.

from_variant(value)[source]
Parameters:

value (GLib.Variant) – a JSON node

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Converts an object that implements Fwupd.Codec from a GLib.Variant value.

New in version 2.0.0.

to_json(builder, flags)[source]
Parameters:

Converts an object that implements Fwupd.Codec to a JSON builder object.

New in version 2.0.0.

to_json_string(flags)[source]
Parameters:

flags (Fwupd.CodecFlags) – a Fwupd.CodecFlags, e.g. Fwupd.CodecFlags.TRUSTED

Raises:

GLib.Error

Returns:

a string

Return type:

str

Converts an object that implements Fwupd.Codec to a JSON string.

New in version 2.0.0.

to_string()[source]
Returns:

a string

Return type:

str

Converts an object that implements Fwupd.Codec to a debug string.

New in version 2.0.0.

to_variant(flags)[source]
Parameters:

flags (Fwupd.CodecFlags) – a Fwupd.CodecFlags, e.g. Fwupd.CodecFlags.TRUSTED

Returns:

a GLib.Variant

Return type:

GLib.Variant

Converts an object that implements Fwupd.Codec to a GLib.Variant.

New in version 2.0.0.

do_add_json(builder, flags) virtual
Parameters:
do_add_string(idt, str) virtual
Parameters:
  • idt (int) – the indent

  • str (GLib.String) – a string to append to

Converts an object that implements Fwupd.Codec to a debug string, appending it to str.

New in version 2.0.0.

do_add_variant(builder, flags) virtual
Parameters:
do_from_json(json_node) virtual
Parameters:

json_node (Json.Node) – a JSON node

Returns:

True on success

Return type:

bool

Converts an object that implements Fwupd.Codec from a JSON object.

New in version 2.0.0.

do_from_variant(value) virtual
Parameters:

value (GLib.Variant) – a JSON node

Returns:

True on success

Return type:

bool

Converts an object that implements Fwupd.Codec from a GLib.Variant value.

New in version 2.0.0.

do_to_string() virtual
Returns:

a string

Return type:

str

Converts an object that implements Fwupd.Codec to a debug string.

New in version 2.0.0.

do_to_variant(flags) virtual
Parameters:

flags (Fwupd.CodecFlags) – a Fwupd.CodecFlags, e.g. Fwupd.CodecFlags.TRUSTED

Returns:

a GLib.Variant

Return type:

GLib.Variant

Converts an object that implements Fwupd.Codec to a GLib.Variant.

New in version 2.0.0.