Top |
char * | audio-encoding | Read / Write |
char * | audio-format | Read / Write |
char * | encoding | Read / Write |
char * | filename | Read / Write |
gpointer | xml-doc | Read / Write |
void | open | Run Last |
void | open-from-data | Run Last |
void | read | Run Last |
void | read-resolve | Run Last |
void | read-start | Run Last |
void | rw-open | Run Last |
void | write | Run Last |
void | write-concurrent | Run Last |
void | write-resolve | Run Last |
#define | AGS_FILE_DEFAULT_APP_ENCODING |
#define | AGS_FILE_DEFAULT_ENCODING |
#define | AGS_FILE_DEFAULT_DTD |
#define | AGS_FILE_CHECKSUM_LENGTH |
#define | AGS_FILE_DEFAULT_AUDIO_FORMAT |
#define | AGS_FILE_DEFAULT_AUDIO_ENCODING |
#define | AGS_FILE_CHARSET_CONVERTER_MAX_STRING_LENGTH |
#define | AGS_FILE_CHARSET_CONVERTER_MAX_CONTENT_LENGTH |
enum | AgsFileFlags |
#define | AGS_FILE_ERROR |
enum | AgsFileError |
The AgsFile is an object to read or write files using XML. It is the persisting layer of Advanced Gtk+ Sequencer.
The application encoding used is either C.UTF-8 or taken from LANG environment variable.
The following functions convert between encoding and app_encoding:
ags_file_xml_new_doc()
ags_file_xml_new_node()
ags_file_xml_get_prop()
ags_file_xml_set_prop()
ags_file_xml_get_content()
ags_file_xml_set_content()
void ags_file_set_filename (AgsFile *file
,gchar *filename
);
Set filename
of file
.
Since: 3.6.17
gchar *
ags_file_get_filename (AgsFile *file
);
Get filename of file
.
Since: 3.6.17
void ags_file_set_encoding (AgsFile *file
,gchar *encoding
);
Set encoding
of file
.
Since: 3.6.17
gchar *
ags_file_get_encoding (AgsFile *file
);
Get encoding of file
.
Since: 3.6.17
void ags_file_set_audio_format (AgsFile *file
,gchar *audio_format
);
Set audio_format
of file
.
Since: 3.6.17
gchar *
ags_file_get_audio_format (AgsFile *file
);
Get audio format of file
.
Since: 3.6.17
void ags_file_set_audio_encoding (AgsFile *file
,gchar *audio_encoding
);
Set audio_encoding
of file
.
Since: 3.6.17
gchar *
ags_file_get_audio_encoding (AgsFile *file
);
Get audio encoding of file
.
Since: 3.6.17
void ags_file_set_xml_doc (AgsFile *file
,xmlDoc *xml_doc
);
Set xml_doc
of file
.
Since: 3.6.17
xmlDoc *
ags_file_get_xml_doc (AgsFile *file
);
Get xml doc of file
.
Since: 3.6.17
gchar * ags_file_str2md5 (gchar *content
,guint content_length
);
Compute MD5 sums of a buffer.
Since: 3.0.0
void ags_file_add_id_ref (AgsFile *file
,GObject *id_ref
);
Adds id_ref
to file
.
Since: 3.0.0
GObject * ags_file_find_id_ref_by_node (AgsFile *file
,xmlNode *node
);
Find a reference by its XML node.
Since: 3.0.0
GObject * ags_file_find_id_ref_by_xpath (AgsFile *file
,gchar *xpath
);
Lookup a reference by xpath
.
Since: 3.0.0
GObject * ags_file_find_id_ref_by_reference (AgsFile *file
,gpointer ref
);
Find a reference matching ref
.
Since: 3.0.0
void ags_file_add_lookup (AgsFile *file
,GObject *file_lookup
);
Add file_lookup
for later invoking.
Since: 3.0.0
void ags_file_add_launch (AgsFile *file
,GObject *file_launch
);
Add file_launch
for later invoking.
Since: 3.0.0
xmlDoc * ags_file_xml_new_doc (AgsFile *file
,gchar *version
);
Create xmlDoc.
Since: 4.0.0
xmlNode * ags_file_xml_new_node (AgsFile *file
,xmlNs *xml_namespace
,gchar *node_name
);
Create xmlNode.
Since: 4.0.0
xmlNode * ags_file_xml_get_root_element (AgsFile *file
,xmlDoc *doc
);
Get root element of doc
.
Since: 4.0.0
void ags_file_xml_set_root_element (AgsFile *file
,xmlDoc *doc
,xmlNode *root_node
);
Set root element root_node
of doc
.
Since: 4.0.0
void ags_file_xml_add_child (AgsFile *file
,xmlNode *parent
,xmlNode *child
);
Set root element root_node
of doc
.
Since: 4.0.0
gchar * ags_file_xml_get_node_name (AgsFile *file
,xmlNode *node
);
Get node name of node
.
Since: 4.0.0
xmlNode * ags_file_xml_get_node_parent (AgsFile *file
,xmlNode *node
);
xmlNode * ags_file_xml_get_node_children (AgsFile *file
,xmlNode *node
);
gchar * ags_file_xml_get_prop (AgsFile *file
,xmlNode *node
,gchar *prop_name
);
Get property of node
.
Since: 4.0.0
void ags_file_xml_set_prop (AgsFile *file
,xmlNode *node
,gchar *prop_name
,gchar *prop_value
);
Set property of node
.
Since: 4.0.0
gchar * ags_file_xml_get_content (AgsFile *file
,xmlNode *node
);
Get content of node
.
Since: 4.0.0
void ags_file_xml_set_content (AgsFile *file
,xmlNode *node
,gchar *content
,gboolean is_cdata
);
Set content of node
.
Since: 4.0.0
void ags_file_open (AgsFile *file
,GError **error
);
Opens the file specified by :filename property.
Since: 3.0.0
void ags_file_open_from_data (AgsFile *file
,gchar *data
,guint length
,GError **error
);
Opens the file provided by data
.
file |
the AgsFile |
|
data |
a buffer containing the XML document |
|
length |
the buffer length |
|
error |
the return location for errors |
Since: 3.0.0
void ags_file_rw_open (AgsFile *file
,gboolean create
,GError **error
);
Opens the file specified by :filename property in read-write mode.
file |
the AgsFile |
|
create |
if |
|
error |
the return location for errors |
Since: 3.0.0
void ags_file_open_filename (AgsFile *file
,gchar *filename
);
Opens the file specified by filename
property.
Since: 3.0.0
void
ags_file_write_resolve (AgsFile *file
);
Resolve references to XPath expressions.
Since: 3.0.0
void
ags_file_read_start (AgsFile *file
);
Update or start the application.
Since: 3.0.0
void ags_file_read_config (AgsFile *file
,xmlNode *node
,GObject **ags_config
);
void ags_file_write_config (AgsFile *file
,xmlNode *parent
,GObject *ags_config
);
void ags_file_read_application_context (AgsFile *file
,xmlNode *node
,GObject **application_context
);
void ags_file_write_application_context (AgsFile *file
,xmlNode *parent
,GObject *application_context
);
#define AGS_FILE_CHARSET_CONVERTER_MAX_STRING_LENGTH (8192)
#define AGS_FILE_CHARSET_CONVERTER_MAX_CONTENT_LENGTH (8388608) // max 8 MB
Enum values to control the behavior or indicate internal state of AgsFile by enable/disable as flags.
“audio-encoding”
property “audio-encoding” char *
The encoding to use for embedding audio data.
Owner: AgsFile
Flags: Read / Write
Default value: "base64"
Since: 3.0.0
“audio-format”
property “audio-format” char *
The format of embedded audio data.
Owner: AgsFile
Flags: Read / Write
Default value: "raw"
Since: 3.0.0
“encoding”
property “encoding” char *
The charset encoding to use.
Owner: AgsFile
Flags: Read / Write
Default value: NULL
Since: 3.0.0
“filename”
property “filename” char *
The assigned filename to open and read from.
Owner: AgsFile
Flags: Read / Write
Default value: NULL
Since: 3.0.0
“open”
signalvoid user_function (AgsFile *file, gpointer error, gpointer user_data)
Open file
with appropriate filename.
file |
the AgsFile |
|
error |
a GError pointer to return error |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.0.0
“open-from-data”
signalvoid user_function (AgsFile *file, char *data, guint length, gpointer error, gpointer user_data)
Open file
from a buffer containing the file.
file |
the AgsFile |
|
data |
the buffer containing the file |
|
length |
the buffer length |
|
error |
a GError pointer to return error |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.0.0
“read”
signalvoid user_function (AgsFile *file, gpointer user_data)
Read a XML document from disk with specified filename.
Flags: Run Last
Since: 3.0.0
“read-resolve”
signalvoid user_function (AgsFile *file, gpointer user_data)
Resolve XPath expressions to their counterpart the newly created instances refering to.
Flags: Run Last
Since: 3.0.0
“read-start”
signalvoid user_function (AgsFile *file, gpointer user_data)
Hook after reading XML document to update or start the application.
Flags: Run Last
Since: 3.0.0
“rw-open”
signalvoid user_function (AgsFile *agsfile, gboolean arg1, gpointer arg2, gpointer user_data)
Flags: Run Last
“write”
signalvoid user_function (AgsFile *file, gpointer user_data)
Write XML Document to disk.
Flags: Run Last
Since: 3.0.0
“write-concurrent”
signalvoid user_function (AgsFile *agsfile, gpointer user_data)
Flags: Run Last