AgsFile

AgsFile — read/write XML file

Functions

Properties

AgsApplicationContext * application-context Read / Write
gchar * audio-encoding Read / Write
gchar * audio-format Read / Write
gchar * encoding Read / Write
gchar * filename Read / Write
gpointer xml-doc Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsFile

Includes

#include <ags/file/ags_file.h>

Description

The AgsFile is an object to read or write files using XML. It is the persisting layer of Advanced Gtk+ Sequencer.

Functions

ags_file_str2md5 ()

gchar *
ags_file_str2md5 (gchar *content,
                  guint content_length);

Compute MD5 sums of a buffer.

Parameters

content

the string buffer

 

content_length

the length of the string

 

Returns

the md5 checksum

Since: 0.4.0


ags_file_add_id_ref ()

void
ags_file_add_id_ref (AgsFile *file,
                     GObject *id_ref);

Adds id_ref to file .

Parameters

file

the AgsFile

 

id_ref

a reference

 

Since: 0.4.0


ags_file_find_id_ref_by_node ()

GObject *
ags_file_find_id_ref_by_node (AgsFile *file,
                              xmlNode *node);


ags_file_find_id_ref_by_xpath ()

GObject *
ags_file_find_id_ref_by_xpath (AgsFile *file,
                               gchar *xpath);

Lookup a reference by xpath .

Parameters

file

the AgsFile

 

xpath

a XPath expression

 

Returns

the matching GObject

Since: 0.4.0


ags_file_find_id_ref_by_reference ()

GObject *
ags_file_find_id_ref_by_reference (AgsFile *file,
                                   gpointer ref);

Find a reference matching ref .

Parameters

file

the AgsFile

 

ref

a gpointer

 

Returns

the matching GObject

Since: 0.4.0


ags_file_add_lookup ()

void
ags_file_add_lookup (AgsFile *file,
                     GObject *file_lookup);

Add file_lookup for later invoking.

Parameters

file

the AgsFile

 

file_lookup

a AgsFileLookup

 

Since: 0.4.0


ags_file_add_launch ()

void
ags_file_add_launch (AgsFile *file,
                     GObject *file_launch);

Add file_launch for later invoking.

Parameters

file

the AgsFile

 

file_launch

a AgsFileLaunch

 

Since: 0.4.0


ags_file_open ()

void
ags_file_open (AgsFile *file,
               GError **error);

Opens the file specified by :filename property.

Parameters

file

the AgsFile

 

error

the return location for errors

 

Since: 0.4.0


ags_file_open_from_data ()

void
ags_file_open_from_data (AgsFile *file,
                         gchar *data,
                         guint length,
                         GError **error);

Opens the file provided by data .

Parameters

file

the AgsFile

 

data

a buffer containing the XML document

 

length

the buffer length

 

error

the return location for errors

 

Since: 0.4.0


ags_file_rw_open ()

void
ags_file_rw_open (AgsFile *file,
                  gboolean create,
                  GError **error);

Opens the file specified by :filename property in read-write mode.

Parameters

file

the AgsFile

 

create

if TRUE create the file as needed

 

error

the return location for errors

 

Since: 0.4.0


ags_file_open_filename ()

void
ags_file_open_filename (AgsFile *file,
                        gchar *filename);

Opens the file specified by filename property.

Parameters

file

the AgsFile

 

filename

a path

 

Since: 0.4.0


ags_file_close ()

void
ags_file_close (AgsFile *file);

Closes file .

Parameters

file

the AgsFile

 

ags_file_write ()

void
ags_file_write (AgsFile *file);

Write the XML document to disk.

Parameters

file

the AgsFile

 

Since: 0.4.0


ags_file_write_concurrent ()

void
ags_file_write_concurrent (AgsFile *file);


ags_file_write_resolve ()

void
ags_file_write_resolve (AgsFile *file);

Resolve references to XPath expressions.

Parameters

file

the AgsFile

 

Since: 0.4.0


ags_file_read ()

void
ags_file_read (AgsFile *file);

Update or start the application.

Parameters

file

the AgsFile

 

Since: 0.4.0


ags_file_read_resolve ()

void
ags_file_read_resolve (AgsFile *file);


ags_file_read_start ()

void
ags_file_read_start (AgsFile *file);


ags_file_read_config ()

void
ags_file_read_config (AgsFile *file,
                      xmlNode *node,
                      GObject **ags_config);


ags_file_write_config ()

void
ags_file_write_config (AgsFile *file,
                       xmlNode *parent,
                       GObject *ags_config);


ags_file_read_application_context ()

void
ags_file_read_application_context (AgsFile *file,
                                   xmlNode *node,
                                   GObject **application_context);


ags_file_write_application_context ()

void
ags_file_write_application_context (AgsFile *file,
                                    xmlNode *parent,
                                    GObject *application_context);


ags_file_new ()

AgsFile *
ags_file_new ();

Creates an AgsFile

Returns

a new AgsFile

Since: 0.3

Types and Values

AGS_FILE_DEFAULT_ENCODING

#define AGS_FILE_DEFAULT_ENCODING "UTF-8\0"


AGS_FILE_DEFAULT_DTD

#define AGS_FILE_DEFAULT_DTD "ags_file.dtd\0"


AGS_FILE_CHECKSUM_LENGTH

#define AGS_FILE_CHECKSUM_LENGTH (g_checksum_type_get_length(G_CHECKSUM_MD5))


AGS_FILE_DEFAULT_AUDIO_FORMAT

#define AGS_FILE_DEFAULT_AUDIO_FORMAT "raw\0"


AGS_FILE_DEFAULT_AUDIO_ENCODING

#define AGS_FILE_DEFAULT_AUDIO_ENCODING "base64\0"


enum AgsFileFlags

Members

AGS_FILE_READ

   

AGS_FILE_READ_AUDIO_SIGNAL

   

AGS_FILE_READ_EMBEDDED_AUDIO

   

AGS_FILE_WRITE

   

AGS_FILE_WRITE_AUDIO_SIGNAL

   

AGS_FILE_WRITE_EMBEDDED_AUDIO

   

AGS_FILE_ERROR

#define AGS_FILE_ERROR (ags_file_error_quark())


enum AgsFileError

Members

AGS_FILE_ERROR_PARSER_FAILURE

   

Property Details

The “application-context” property

  “application-context”      AgsApplicationContext *

The application context to write to file.

Flags: Read / Write

Since: 0.7.0


The “audio-encoding” property

  “audio-encoding”           gchar *

The audio encoding used to embedded audio.

Flags: Read / Write

Default value: "base64"

Since: 0.5.0


The “audio-format” property

  “audio-format”             gchar *

The audio format used to embedded audio.

Flags: Read / Write

Default value: "raw"

Since: 0.5.0


The “encoding” property

  “encoding”                 gchar *

The encoding of the XML document.

Flags: Read / Write

Default value: NULL

Since: 0.5.0


The “filename” property

  “filename”                 gchar *

The filename to read or write to.

Flags: Read / Write

Default value: NULL

Since: 0.5.0


The “xml-doc” property

  “xml-doc”                  gpointer

The xml document assigned with file.

Flags: Read / Write

Since: 0.7.3

Signal Details

The “open” signal

void
user_function (AgsFile *file,
               gpointer error,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “open-from-data” signal

void
user_function (AgsFile *file,
               gchar   *create,
               guint    error,
               gpointer arg3,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “read” signal

void
user_function (AgsFile *file,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “read-resolve” signal

void
user_function (AgsFile *file,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “read-start” signal

void
user_function (AgsFile *file,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “rw-open” signal

void
user_function (AgsFile *agsfile,
               gboolean arg1,
               gpointer arg2,
               gpointer user_data)

Flags: Run Last


The “write” signal

void
user_function (AgsFile *file,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0


The “write-concurrent” signal

void
user_function (AgsFile *agsfile,
               gpointer user_data)

Flags: Run Last


The “write-resolve” signal

void
user_function (AgsFile *file,
               gpointer user_data)

Flags: Run Last

Since: 0.5.0