Fwupd.Codec¶
- Implementations:
Fwupd.BiosSetting,Fwupd.Device,Fwupd.Plugin,Fwupd.Release,Fwupd.Remote,Fwupd.Report,Fwupd.Request,Fwupd.SecurityAttr
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Fwupd.Codec¶
- Bases:
- Structure:
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:
value (
GLib.Variant) – a JSON nodegtype (
GObject.GType) – aGObject.GTypethat implementsFwupdCodec
- Raises:
- Returns:
Trueon success- Return type:
Converts an array of objects, each deserialized from a
GLib.Variantvalue.New in version 2.0.0.
- classmethod array_to_json(array, member_name, builder, flags)[source]¶
- Parameters:
array ([
GObject.Object]) – (not nullable): array of objects that much implementFwupdCodecmember_name (
str) – member name of the arraybuilder (
Json.Builder) – aJson.Builderflags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED
Converts an array of objects into a
GLib.Variantvalue.New in version 2.0.0.
- classmethod array_to_variant(array, flags)[source]¶
- Parameters:
array ([
GObject.Object]) – (not nullable): array of objects that much implementFwupdCodecflags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED
- Returns:
- Return type:
Converts an array of objects into a
GLib.Variantvalue.New in version 2.0.0.
- classmethod json_append(builder, key, value)[source]¶
- Parameters:
builder (
Json.Builder) – aJson.Builderkey (
str) – a stringvalue (
str) – a string to append
Appends a key and value to a JSON builder.
New in version 2.0.0.
- classmethod json_append_bool(builder, key, value)[source]¶
- Parameters:
builder (
Json.Builder) – aJson.Builderkey (
str) – a stringvalue (
bool) – boolean
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:
builder (
Json.Builder) – aJson.Builderkey (
str) – a stringvalue (
int) – guint64
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:
builder (
Json.Builder) – aJson.Builderkey (
str) – a stringvalue (
str) – a #GStrv
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:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
str) – a string to append
Appends a key and value to a string.
New in version 2.0.0.
- classmethod string_append_bool(str, idt, key, value)[source]¶
- Parameters:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
bool) – Boolean
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:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
int) – guint64
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:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
int) – guint64
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:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
int) – guint64
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:
str (
GLib.String) – aGLib.Stringidt (
int) – the indentkey (
str) – a string to appendvalue (
int) – guint64 UNIX time
Appends a key and time value to a string.
New in version 2.0.0.
- add_string(idt, str)[source]¶
- Parameters:
idt (
int) – the indentstr (
GLib.String) – a string to append to
Converts an object that implements
Fwupd.Codecto a debug string, appending it to str.New in version 2.0.0.
- from_json(json_node)[source]¶
-
Converts an object that implements
Fwupd.Codecfrom a JSON object.New in version 2.0.0.
- from_json_string(json)[source]¶
-
Converts an object that implements
Fwupd.Codecfrom a JSON string.New in version 2.0.0.
- from_variant(value)[source]¶
- Parameters:
value (
GLib.Variant) – a JSON node- Raises:
- Returns:
Trueon success- Return type:
Converts an object that implements
Fwupd.Codecfrom aGLib.Variantvalue.New in version 2.0.0.
- to_json(builder, flags)[source]¶
- Parameters:
builder (
Json.Builder) – a JSON builderflags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED
Converts an object that implements
Fwupd.Codecto a JSON builder object.New in version 2.0.0.
- to_json_string(flags)[source]¶
- Parameters:
flags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED- Raises:
- Returns:
a string
- Return type:
Converts an object that implements
Fwupd.Codecto a JSON string.New in version 2.0.0.
- to_string()[source]¶
- Returns:
a string
- Return type:
Converts an object that implements
Fwupd.Codecto a debug string.New in version 2.0.0.
- to_variant(flags)[source]¶
- Parameters:
flags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED- Returns:
- Return type:
Converts an object that implements
Fwupd.Codecto aGLib.Variant.New in version 2.0.0.
- do_add_json(builder, flags) virtual¶
- Parameters:
builder (
Json.Builder) –flags (
Fwupd.CodecFlags) –
- do_add_string(idt, str) virtual¶
- Parameters:
idt (
int) – the indentstr (
GLib.String) – a string to append to
Converts an object that implements
Fwupd.Codecto a debug string, appending it to str.New in version 2.0.0.
- do_add_variant(builder, flags) virtual¶
- Parameters:
builder (
GLib.VariantBuilder) –flags (
Fwupd.CodecFlags) –
- do_from_json(json_node) virtual¶
-
Converts an object that implements
Fwupd.Codecfrom a JSON object.New in version 2.0.0.
- do_from_variant(value) virtual¶
- Parameters:
value (
GLib.Variant) – a JSON node- Returns:
Trueon success- Return type:
Converts an object that implements
Fwupd.Codecfrom aGLib.Variantvalue.New in version 2.0.0.
- do_to_string() virtual¶
- Returns:
a string
- Return type:
Converts an object that implements
Fwupd.Codecto a debug string.New in version 2.0.0.
- do_to_variant(flags) virtual¶
- Parameters:
flags (
Fwupd.CodecFlags) – aFwupd.CodecFlags, e.g.Fwupd.CodecFlags.TRUSTED- Returns:
- Return type:
Converts an object that implements
Fwupd.Codecto aGLib.Variant.New in version 2.0.0.