Main Page   Class Hierarchy   Compound List   Compound Members  

agfio Class Reference

AG file I/O interface. More...

List of all members.

Public Methods

list< AGId > load (const string &format, const string &filename, const Id &id="", map< string, string > *signalInfo=NULL, map< string, string > *options=NULL) throw (LoadError)
string store (const string &format, const string &filename, const Id &id, map< string, string > *options=NULL) throw (StoreError)
string store (const string &format, const string &filename, list< string > *const ids, map< string, string > *options=NULL) throw (StoreError)


Detailed Description

AG file I/O interface.

Agfio defines an interface to file I/O modules for application programs. Two file I/O operations (load and store) and exceptions during those operations are defined in agfio. Internally, agfio also performs file I/O plugin management.


Member Function Documentation

list<AGId> agfio::load const string &    format,
const string &    filename,
const Id &    id = "",
map< string, string > *    signalInfo = NULL,
map< string, string > *    options = NULL
throw (LoadError)
 

Load a file, converting it to AG's. To be more specific, load() locates the plugin for the given format and calls the load() function of the plugin with the given parameters.

The way how the function parameters are used varies over file I/O modules(plugins). For example, some modules don't use id, some modules don't use signalInfo. Also available options, which are specified using options parameter, different for different file I/O formats. See File I/O plugins for details of each file I/O module(plugin).

Parameters:
format  Name of the file format.
filename  A path (absolute or relative) to the file.
id  AGSetId or AGId into which the file will be loaded.
signalInfo  A feature-value pair list for the signal information. Features that should be used are:
  • uri
  • mimeClass
  • mimeType
  • encoding
  • unit
  • track (optional)
The values shouldn't be empty.
options  A option-value pair list that is used to change the behavior of load() of the I/O module(plugin).
Returns:
List of ids of created AG's

string agfio::store const string &    format,
const string &    filename,
list< string > *const    ids,
map< string, string > *    options = NULL
throw (StoreError)
 

Same as store() below except that this one accepts a list of AGId's instead of just one AGId/AGSetId.

string agfio::store const string &    format,
const string &    filename,
const Id &    id,
map< string, string > *    options = NULL
throw (StoreError)
 

Store AG's to a file in the specified format. Note that it is usually impossible to store the loaded AG's using a different format (except for AG and CAG formats) than the one used for loading.

Parameters:
format  Target format in which the given annotaiton graphs are stored.
filename  The name of the file to be written.
id  The id of AG or AGSet to be stored. Some formats require AGId but some formats require AGSetId. Some formats can accept both. See File I/O plugins for details.
options  A option-value pair list that is used to change the behavior of store() of the I/O module(plugin). See File I/O plugins for available options for different formats.
Returns:
An optional string. Usually you can ignore this, but for some formats it might be meaningfull.