Gsf.XMLOut¶
| Subclasses: | Gsf.ODFOut | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(output) | 
| add_base64(id, data) | |
| add_bool(id, val) | |
| add_color(id, r, g, b) | |
| add_cstr(id, val_utf8) | |
| add_cstr_unchecked(id, val_utf8) | |
| add_enum(id, etype, val) | |
| add_float(id, val, precision) | |
| add_gvalue(id, val) | |
| add_int(id, val) | |
| add_uint(id, val) | |
| end_element() | |
| get_output() | |
| get_pretty_print() | |
| set_doc_type(type) | |
| set_pretty_print(pp) | |
| simple_element(id, content) | |
| simple_float_element(id, val, precision) | |
| simple_int_element(id, val) | |
| start_element(id) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| pretty-print | bool | r/w | Should the output auto-indent elements to make reading easier? | 
| sink | Gsf.Output | r/w/co | The destination for writes | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| base | GObject.Object | r | |
| output | Gsf.Output | r | |
| priv | object | r | 
Class Details¶
- 
class Gsf.XMLOut(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Gsf.XMLOutClass- 
classmethod new(output)¶
- Parameters: - output ( - Gsf.Output) –- Gsf.Output- Returns: - Gsf.XMLOut- Return type: - Gsf.XMLOut- Create an XML output stream. 
 - 
add_base64(id, data)¶
- Parameters: - Dump len bytes in data into the content of node id using base64 
 - 
add_bool(id, val)¶
- Parameters: - 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 - Nonedo 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 - Nonedo nothing (no warning, no output)
 - 
add_enum(id, etype, val)¶
- Parameters: - id (strorNone) – tag id, orNonefor node content
- etype (GObject.GType) –GObject.GType
- val (int) – enum element number
 - Output the name of value val of enumeration type etype. 
- id (
 - 
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: - id (strorNone) – tag id, orNonefor node content
- val (GObject.Value) –GObject.Value
 - Output the value of val as a string. Does NOT store any type information with the string, just thevalue. 
- id (
 - 
add_int(id, val)¶
- Parameters: - dump integer value val to an attribute named id or as the nodes content 
 - 
add_uint(id, val)¶
- Parameters: - 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: - str- Closes/ends an XML element. 
 - 
get_output()¶
- Returns: - Gsf.Input- Return type: - Gsf.Outputor- None- Get the - Gsf.Outputwe are writing to..
 - 
get_pretty_print()¶
- Returns: - the current state of the pretty-print flag. Note, that - Gsf.XMLOut.set_pretty_printwill return the same value.- Return type: - bool
 - 
set_doc_type(type)¶
- Parameters: - type ( - str) – the document type declaration- Store some optional <!DOCTYPE .. > content 
 - 
set_pretty_print(pp)¶
- Parameters: - pp ( - bool) – new state of pretty-print flag.- Returns: - the previous state of the pretty-print flag. - Return type: - bool
 - 
simple_element(id, content)¶
- Parameters: - 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)¶
- Parameters: - Convenience routine to output an element id with integer value val. 
 
- 
classmethod 
Property Details¶
- 
Gsf.XMLOut.props.pretty_print¶
- Name: - pretty-print- Type: - bool- Default Value: - True- Flags: - READABLE,- WRITABLE- Should the output auto-indent elements to make reading easier? 
- 
Gsf.XMLOut.props.sink¶
- Name: - sink- Type: - Gsf.Output- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The destination for writes