Class: Gsf::XMLOut
- Inherits:
-
Object
- Object
- Gsf::XMLOut
- Defined in:
- (unknown)
Direct Known Subclasses
Instance Method Summary collapse
-
#add_base64(id, data, len) ⇒ nil
Dump len bytes in data into the content of node id using base64.
-
#add_bool(id, val) ⇒ nil
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) ⇒ nil
dump Color r.g.b to an attribute named id or as the nodes content.
-
#add_cstr(id, val_utf8) ⇒ nil
dump val_utf8 to an attribute named id or as the nodes content escaping characters as necessary.
-
#add_cstr_unchecked(id, val_utf8) ⇒ nil
dump val_utf8 to an attribute named id without checking to see if the content needs escaping.
-
#add_enum(id, etype, val) ⇒ nil
Output the name of value val of enumeration type etype.
-
#add_float(id, val, precision) ⇒ nil
dump float value val to an attribute named id or as the nodes content with precision precision.
-
#add_gvalue(id, val) ⇒ nil
Output the value of val as a string.
-
#add_int(id, val) ⇒ nil
dump integer value val to an attribute named id or as the nodes content.
-
#add_uint(id, val) ⇒ nil
dump unsigned integer value val to an attribute named id or as the nodes content.
-
#doc_type=(type) ⇒ nil
Store some optional <!DOCTYPE ..
-
#end_element ⇒ String
Closes/ends an XML element.
-
#initialize(output) ⇒ Gsf::XMLOut
constructor
Create an XML output stream.
-
#output ⇒ Gsf::Output
Get the Gsf::Output we are writing to..
-
#pretty_print ⇒ Boolean
gsf_xml_out_set_pretty_print will return the same value.
- #pretty_print=(pretty_print) ⇒ Boolean
-
#pretty_print? ⇒ Boolean
Pretty-print.
-
#simple_element(id, content) ⇒ nil
Convenience routine to output a simple id element with content content.
-
#simple_float_element(id, val, precision) ⇒ nil
Convenience routine to output an element id with float value val using precision significant digits.
-
#simple_int_element(id, val) ⇒ nil
Convenience routine to output an element id with integer value val.
-
#sink ⇒ Gsf::Output
Sink.
- #sink=(sink) ⇒ Gsf::Output
-
#start_element(id) ⇒ nil
Output a start element id, if necessary preceeded by an XML declaration.
Constructor Details
#initialize(output) ⇒ Gsf::XMLOut
Create an XML output stream.
Instance Method Details
#add_base64(id, data, len) ⇒ nil
Dump len bytes in data into the content of node id using base64
#add_bool(id, val) ⇒ nil
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) ⇒ nil
dump Color r.g.b to an attribute named id or as the nodes content
#add_cstr(id, val_utf8) ⇒ nil
dump val_utf8 to an attribute named id or as the nodes content escaping characters as necessary. If val_utf8 is nil do nothing (no warning, no output)
#add_cstr_unchecked(id, val_utf8) ⇒ nil
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 nil do nothing (no warning, no output)
#add_enum(id, etype, val) ⇒ nil
Output the name of value val of enumeration type etype.
#add_float(id, val, precision) ⇒ nil
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) ⇒ nil
Output the value of val as a string. Does NOT store any type information with the string, just thevalue.
#add_int(id, val) ⇒ nil
dump integer value val to an attribute named id or as the nodes content
#add_uint(id, val) ⇒ nil
dump unsigned integer value val to an attribute named id or as the nodes content
#doc_type=(type) ⇒ nil
Store some optional <!DOCTYPE .. > content
#end_element ⇒ String
Closes/ends an XML element.
#output ⇒ Gsf::Output
Get the Gsf::Output we are writing to..
#pretty_print ⇒ Boolean
gsf_xml_out_set_pretty_print will return the same value.
#pretty_print=(pretty_print) ⇒ Boolean
#pretty_print? ⇒ Boolean
Returns pretty-print.
#simple_element(id, content) ⇒ nil
Convenience routine to output a simple id element with content content.
#simple_float_element(id, val, precision) ⇒ nil
Convenience routine to output an element id with float value val using precision significant digits.
#simple_int_element(id, val) ⇒ nil
Convenience routine to output an element id with integer value val.
#sink ⇒ Gsf::Output
Returns sink.
#sink=(sink) ⇒ Gsf::Output
#start_element(id) ⇒ nil
Output a start element id, if necessary preceeded by an XML declaration.