Gsf.XMLOut¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Should the output auto-indent elements to make reading easier? |
||
r/w/co |
The destination for writes |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
base |
r |
||
output |
r |
||
priv |
r |
Class Details¶
- class Gsf.XMLOut(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(output)¶
- Parameters:
output (
Gsf.Output
) –Gsf.Output
- Returns:
- Return type:
Create an XML output stream.
- add_base64(id, data)¶
-
Dump len bytes in data into the content of node id using base64
- add_bool(id, val)¶
-
dump boolean value val to an attribute named id or as the nodes content Use ‘1’ or ‘0’ to simplify import
- add_color(id, r, g, b)¶
- Parameters:
dump Color r.`g`.`b` to an attribute named id or as the nodes content
- add_cstr(id, val_utf8)¶
- Parameters:
dump val_utf8 to an attribute named id or as the nodes content escaping characters as necessary. If val_utf8 is
None
do nothing (no warning, no output)
- add_cstr_unchecked(id, val_utf8)¶
- Parameters:
dump val_utf8 to an attribute named id without checking to see if the content needs escaping. A useful performance enhancement when the application knows that structure of the content well. If val_utf8 is
None
do nothing (no warning, no output)
- add_enum(id, etype, val)¶
- Parameters:
etype (
GObject.GType
) –GObject.GType
val (
int
) – enum element number
Output the name of value val of enumeration type etype.
- add_float(id, val, precision)¶
- Parameters:
dump float value val to an attribute named id or as the nodes content with precision precision. The number will be formattted according to the “C” locale.
- add_gvalue(id, val)¶
- Parameters:
val (
GObject.Value
) –GObject.Value
Output the value of val as a string. Does NOT store any type information with the string, just thevalue.
- add_int(id, val)¶
-
dump integer value val to an attribute named id or as the nodes content
- add_uint(id, val)¶
-
dump unsigned integer value val to an attribute named id or as the nodes content
- end_element()¶
- Returns:
the element that has been closed.
- Return type:
Closes/ends an XML element.
- get_output()¶
- Returns:
- Return type:
Gsf.Output
orNone
Get the
Gsf.Output
we are writing to..
- get_pretty_print()¶
- Returns:
the current state of the pretty-print flag. Note, that
Gsf.XMLOut.set_pretty_print
will return the same value.- Return type:
- set_doc_type(type)¶
- Parameters:
type (
str
) – the document type declaration
Store some optional <!DOCTYPE .. > content
- set_pretty_print(pp)¶
- simple_element(id, content)¶
-
Convenience routine to output a simple id element with content content.
- simple_float_element(id, val, precision)¶
- Parameters:
Convenience routine to output an element id with float value val using precision significant digits.
- simple_int_element(id, val)¶
-
Convenience routine to output an element id with integer value val.
Property Details¶
- Gsf.XMLOut.props.pretty_print¶
-
Should the output auto-indent elements to make reading easier?
- Gsf.XMLOut.props.sink¶
- Name:
sink
- Type:
- Default Value:
- Flags:
The destination for writes