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.GType
that implementsFwupdCodec
- Raises:
- Returns:
True
on success- Return type:
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:
array ([
GObject.Object
]) – (not nullable): array of objects that much implementFwupdCodec
member_name (
str
) – member name of the arraybuilder (
Json.Builder
) – aJson.Builder
flags (
Fwupd.CodecFlags
) – aFwupd.CodecFlags
, e.g.Fwupd.CodecFlags.TRUSTED
Converts an array of objects into a
GLib.Variant
value.New in version 2.0.0.
- classmethod array_to_variant(array, flags)[source]¶
- Parameters:
array ([
GObject.Object
]) – (not nullable): array of objects that much implementFwupdCodec
flags (
Fwupd.CodecFlags
) – aFwupd.CodecFlags
, e.g.Fwupd.CodecFlags.TRUSTED
- Returns:
- Return type:
Converts an array of objects into a
GLib.Variant
value.New in version 2.0.0.
- classmethod json_append(builder, key, value)[source]¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
key (
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.Builder
key (
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.Builder
key (
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.Builder
key (
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.String
idt (
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.String
idt (
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.String
idt (
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.String
idt (
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.String
idt (
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.String
idt (
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.Codec
to a debug string, appending it to str.New in version 2.0.0.
- from_json(json_node)[source]¶
-
Converts an object that implements
Fwupd.Codec
from a JSON object.New in version 2.0.0.
- from_json_string(json)[source]¶
-
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:
- Returns:
True
on success- Return type:
Converts an object that implements
Fwupd.Codec
from aGLib.Variant
value.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.Codec
to 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.Codec
to a JSON string.New in version 2.0.0.
- to_string()[source]¶
- Returns:
a string
- Return type:
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
) – aFwupd.CodecFlags
, e.g.Fwupd.CodecFlags.TRUSTED
- Returns:
- Return type:
Converts an object that implements
Fwupd.Codec
to 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.Codec
to 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.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:
Converts an object that implements
Fwupd.Codec
from aGLib.Variant
value.New in version 2.0.0.
- do_to_string() virtual¶
- Returns:
a string
- Return type:
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
) – aFwupd.CodecFlags
, e.g.Fwupd.CodecFlags.TRUSTED
- Returns:
- Return type:
Converts an object that implements
Fwupd.Codec
to aGLib.Variant
.New in version 2.0.0.