Functions¶
Details¶
- Gsf.base64_decode_simple(data, len)¶
- Parameters:
- Returns:
the number of bytes converted
- Return type:
Decodes a chunk of base64 encoded data from data back into data.
- Gsf.base64_decode_step(in_, len, out, state, save)¶
- Parameters:
- Returns:
the number of bytes converted
- state:
holds the number of bits that are stored in save
- save:
leftover bits that have not yet been decoded
- Return type:
Decodes a chunk of base64 encoded data
- Gsf.base64_encode_close(in_, break_lines, out, state, save)¶
- Parameters:
- Returns:
a count of the number of bytes in the final block.
- state:
holds the number of bits that are stored in save
- save:
leftover bits that have not yet been decoded
- Return type:
This funcion should be called to when finished encoding everything, to flush off the last little bit.
- Gsf.base64_encode_simple(data, len)¶
- Parameters:
- Returns:
the number of bytes encoded
- Return type:
Encodes data from data back into data using base64 encoding.
- Gsf.base64_encode_step(in_, len, break_lines, out, state, save)¶
- Parameters:
- Returns:
the number of bytes encoded
- state:
holds the number of bits that are stored in save
- save:
leftover bits that have not yet been decoded
- Return type:
Performs an ‘encode step’, only encodes blocks of 3 characters from in into the output out at a time, saves left-over state in state and save (initialise to 0 on first invocation).
- Gsf.doc_meta_dump(meta)¶
- Parameters:
meta (
Gsf.DocMetaData
) –Gsf.DocMetaData
A debugging utility to dump the content of meta via g_print
- Gsf.error_quark()¶
- Returns:
the #GQuark used to identify libgsf errors in
GLib.Error
structures. Specific error codes come from theGsf.Error
enumeration.- Return type:
- Gsf.extension_pointer(path)¶
- Parameters:
path (
str
) – A filename or file path.- Returns:
A pointer to the extension part of the filename, or a pointer to the end of the string if the filename does not have an extension.
- Return type:
Extracts the extension from the end of a filename (the part after the final ‘.’ in the filename).
- Gsf.filename_to_utf8(filename, quoted)¶
- Parameters:
- Returns:
filename using utf-8 encoding for display
- Return type:
A utility wrapper to make sure filenames are valid utf8. Caller must
GLib.free
the result.
- Gsf.init()¶
Initializes the GSF library
- Gsf.init_dynamic(module)¶
- Parameters:
module (
GObject.TypeModule
) –GObject.TypeModule
.
Initializes the GSF library and associates it with a type module mod.
- Gsf.le_get_double(p)¶
-
Interpret binary data as a double in little endian order.
- Gsf.le_get_float(p)¶
-
Interpret binary data as a float in little endian order.
- Gsf.le_get_guint64(p)¶
-
Interpret binary data as a guint64 (8 byte unsigned integer type) in little endian order.
- Gsf.le_set_double(p, d)¶
-
Store a value of type double in memory in little endian order
- Gsf.le_set_float(p, f)¶
-
Store a value of type float in memory in little endian order.
- Gsf.mem_dump(ptr, len)¶
-
Dump len bytes from the memory location given by ptr.
- Gsf.msole_iconv_win_codepage()¶
- Returns:
our best guess at the applicable windows code page based on an environment variable or the current locale.
- Return type:
- Gsf.msole_inflate(input, offset)¶
- Parameters:
- Returns:
A
GLib.ByteArray
that the caller is responsible for freeing- Return type:
Decompresses an LZ compressed stream.
- Gsf.msole_language_for_lid(lid)¶
- Gsf.msole_lid_for_language(lang)¶
- Gsf.msole_lid_to_codepage(lid)¶
- Gsf.msole_lid_to_codepage_str(lid)¶
- Gsf.odf_get_ns()¶
- Returns:
the used ODF namespace
- Return type:
New in version 1.14.24.
- Gsf.odf_get_version()¶
- Returns:
the ODF version: 102.
- Return type:
Gives the ODF version used by libgsf when writing Open Document files.
New in version 1.14.24.
- Gsf.odf_get_version_string()¶
- Returns:
the ODF version as a string: “1.2”.
- Return type:
Gives the ODF version used by libgsf when writing Open Document files.
New in version 1.14.24.
- Gsf.open_pkg_foreach_rel(opkg, func, *user_data)¶
- Parameters:
func (
Gsf.OpenPkgIter
) –Gsf.OpenPkgIter
New in 1.14.9
Walks each relationship associated with opkg and calls func with user_data.
- Gsf.open_pkg_open_rel(opkg, rel)¶
- Parameters:
rel (
Gsf.OpenPkgRel
) –Gsf.OpenPkgRel
- Raises:
- Returns:
a new
Gsf.Input
which the called needs to unref, orNone
and sets err- Return type:
- Gsf.open_pkg_open_rel_by_id(opkg, id)¶
- Parameters:
- Raises:
- Returns:
- Return type:
New in 1.14.7
Open opkg's relation id
- Gsf.open_pkg_open_rel_by_type(opkg, type)¶
- Parameters:
- Raises:
- Returns:
- Return type:
New in 1.14.9
Open one of opkg's relationships with type=`type`.
- Gsf.open_pkg_parse_rel_by_id(xin, id, dtd, ns)¶
- Parameters:
id (
str
) – target iddtd (
Gsf.XMLInNode
) –Gsf.XMLInNode
ns (
Gsf.XMLInNS
) –Gsf.XMLInNS
- Returns:
None
on success or aGLib.Error
on failure.- Return type:
Convenience function to parse a related part.
- Gsf.property_settings_find(name, params)¶
- Parameters:
name (
str
) –params ([
GObject.Parameter
]) –
- Return type:
- Gsf.property_settings_free(params)¶
- Parameters:
params ([
GObject.Parameter
]) –
- Gsf.shutdown()¶
De-intializes the GSF library Currently does nothing.
- Gsf.shutdown_dynamic(module)¶
- Parameters:
module (
GObject.TypeModule
) – currently unused
De-intializes the GSF library from a type module. Currently does nothing.
- Gsf.value_get_docprop_array(value)¶
- Parameters:
value (
GObject.Value
) – AGObject.Value
of typeGsf.DocPropVector
.- Returns:
A
GLib.Array
ofGObject.Value
- Return type:
[
GObject.Value
] orNone
This function returns the array of values inside
Gsf.DocPropVector
. No additional references are created.
- Gsf.value_get_docprop_varray(value)¶
- Parameters:
value (
GObject.Value
) –- Return type:
- Gsf.value_get_docprop_vector(value)¶
- Parameters:
value (
GObject.Value
) – AGObject.Value
of typeGsf.DocPropVector
.- Returns:
A pointer to the
Gsf.DocPropVector
structure in value- Return type:
This function returns a pointer to the
Gsf.DocPropVector
structure in value. No additional references are created.
- Gsf.vba_inflate(input, offset, size, add_null_terminator)¶
- Parameters:
- Returns:
A pointer to guint8 array
- Return type:
Decompresses VBA stream.
- Gsf.xmlDocFormatDump(output, cur, encoding, format)¶
- Parameters:
output (
Gsf.Output
) –Gsf.Output
cur (
libxml2.Doc
) –libxml2.DocPtr
- Returns:
status from xmlSaveFormatFileTo.
- Return type:
Dumps the document cur into output.
- Gsf.xml_gvalue_from_str(res, t, str)¶
- Parameters:
res (
GObject.Value
) – Result valuet (
GObject.GType
) – Type of datastr (
str
) – Value string
- Returns:
True when parsing of str as a value of type t was succesfull; false otherwise.
- Return type:
Try to parse str as a value of type t into res.
- Gsf.xml_probe(input, func)¶
- Parameters:
func (
Gsf.XMLProbeFunc
) –Gsf.XMLProbeFunc
- Returns:
True
on success.- Return type: