Class: Gsf::XMLOut

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Direct Known Subclasses

ODFOut

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Gsf::XMLOut

Create an XML output stream.

Parameters:

Instance Method Details

#add_base64(id, data, len) ⇒ nil

Dump len bytes in data into the content of node id using base64

Parameters:

  • id (String)

    tag id, or nil for node content

  • data (Array<Integer>)

    Data to be written

  • len (Integer)

    Length of data

Returns:

  • (nil)

#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

Parameters:

  • id (String)

    tag id, or nil for node content

  • val (Boolean)

    a boolean

Returns:

  • (nil)

#add_color(id, r, g, b) ⇒ nil

dump Color r.g.b to an attribute named id or as the nodes content

Parameters:

  • id (String)

    tag id, or nil for node content

  • r (Integer)

    Red value

  • g (Integer)

    Green value

  • b (Integer)

    Blue value

Returns:

  • (nil)

#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)

Parameters:

  • id (String)

    tag id, or nil for node content

  • val_utf8 (String)

    a utf8 encoded string

Returns:

  • (nil)

#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)

Parameters:

  • id (String)

    tag id, or nil for node content

  • val_utf8 (String)

    a utf8 encoded string to export

Returns:

  • (nil)

#add_enum(id, etype, val) ⇒ nil

Output the name of value val of enumeration type etype.

Parameters:

  • id (String)

    tag id, or nil for node content

  • etype (GLib::Type)

    #GType

  • val (Integer)

    enum element number

Returns:

  • (nil)

#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.

Parameters:

  • id (String)

    tag id, or nil for node content

  • val (Float)

    the value

  • precision (Integer)

    the number of significant digits to use, -1 meaning "enough".

Returns:

  • (nil)

#add_gvalue(id, val) ⇒ nil

Output the value of val as a string. Does NOT store any type information with the string, just thevalue.

Parameters:

  • id (String)

    tag id, or nil for node content

  • val (GObject::Value)

    #GValue

Returns:

  • (nil)

#add_int(id, val) ⇒ nil

dump integer value val to an attribute named id or as the nodes content

Parameters:

  • id (String)

    tag id, or nil for node content

  • val (Integer)

    the value

Returns:

  • (nil)

#add_uint(id, val) ⇒ nil

dump unsigned integer value val to an attribute named id or as the nodes content

Parameters:

  • id (String)

    tag id, or nil for node content

  • val (Integer)

    the value

Returns:

  • (nil)

#doc_type=(type) ⇒ nil

Store some optional <!DOCTYPE .. > content

Parameters:

  • type (String)

    the document type declaration

Returns:

  • (nil)

#end_elementString

Closes/ends an XML element.

Returns:

  • (String)

    the element that has been closed.

#outputGsf::Output

Get the Gsf::Output we are writing to..

Returns:

#pretty_printBoolean

gsf_xml_out_set_pretty_print will return the same value.

Returns:

  • (Boolean)

    the current state of the pretty-print flag. Note, that

#pretty_print=(pretty_print) ⇒ Boolean

Parameters:

  • pretty_print (Boolean)

Returns:

  • (Boolean)

    pretty-print

  • (Boolean)

    pretty-print

#pretty_print?Boolean

Returns pretty-print.

Returns:

  • (Boolean)

    pretty-print

#simple_element(id, content) ⇒ nil

Convenience routine to output a simple id element with content content.

Parameters:

  • id (String)

    Element name

  • content (String)

    Content of the element

Returns:

  • (nil)

#simple_float_element(id, val, precision) ⇒ nil

Convenience routine to output an element id with float value val using precision significant digits.

Parameters:

  • id (String)

    Element name

  • val (Float)

    Element value

  • precision (Integer)

    the number of significant digits to use, -1 meaning "enough".

Returns:

  • (nil)

#simple_int_element(id, val) ⇒ nil

Convenience routine to output an element id with integer value val.

Parameters:

  • id (String)

    Element name

  • val (Integer)

    Element value

Returns:

  • (nil)

#sinkGsf::Output

Returns sink.

Returns:

#sink=(sink) ⇒ Gsf::Output

Parameters:

Returns:

#start_element(id) ⇒ nil

Output a start element id, if necessary preceeded by an XML declaration.

Parameters:

  • id (String)

    Element name

Returns:

  • (nil)