Generic Im- and Exporter
[API for Applications]


Detailed Description

Generic Financial Data Importer/Exporter.

This group contains a generic importer/exporter.

Importing

When importing this group reads transactions and accounts from a given stream (in most cases a file) and stores them in a given importer context.

The application can later browse through all transactions stored within the given context and import them into its own database as needed.


Modules

 Im- and Exporter Context
 Im- and Exporter Account Info

Plugin Handling

GWEN_PLUGIN_DESCRIPTION_LIST2 * AB_Banking_GetImExporterDescrs (AB_BANKING *ab)
AB_IMEXPORTERAB_Banking_GetImExporter (AB_BANKING *ab, const char *name)
GWEN_DB_NODE * AB_Banking_GetImExporterProfiles (AB_BANKING *ab, const char *name)

Virtual Functions for Backends

int AB_ImExporter_Import (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_IO_LAYER *io, GWEN_DB_NODE *dbProfile, uint32_t guiid)
int AB_ImExporter_Export (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_IO_LAYER *io, GWEN_DB_NODE *dbProfile, uint32_t guiid)
int AB_ImExporter_ImportFile (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, const char *fname, GWEN_DB_NODE *dbProfile, uint32_t guiid)
int AB_ImExporter_ImportBuffer (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_BUFFER *buf, GWEN_DB_NODE *dbProfile, uint32_t guiid)
int AB_ImExporter_CheckFile (AB_IMEXPORTER *ie, const char *fname, uint32_t guiid)

Typedefs

typedef struct AB_IMEXPORTER AB_IMEXPORTER
typedef struct
AB_IMEXPORTER_CONTEXT 
AB_IMEXPORTER_CONTEXT
typedef struct
AB_IMEXPORTER_ACCOUNTINFO 
AB_IMEXPORTER_ACCOUNTINFO

Functions

AB_BANKINGAB_ImExporter_GetBanking (const AB_IMEXPORTER *ie)
const char * AB_ImExporter_GetName (const AB_IMEXPORTER *ie)


Typedef Documentation

typedef struct AB_IMEXPORTER AB_IMEXPORTER

Definition at line 49 of file imexporter.h.

Definition at line 53 of file imexporter.h.

Definition at line 52 of file imexporter.h.


Function Documentation

AB_IMEXPORTER* AB_Banking_GetImExporter ( AB_BANKING ab,
const char *  name 
)

Loads an importer/exporter backend with the given name. You can use AB_Banking_GetImExporterDescrs to retrieve a list of available im-/exporters. AqBanking remains the owner of the object returned (if any), so you must not free it.

GWEN_PLUGIN_DESCRIPTION_LIST2* AB_Banking_GetImExporterDescrs ( AB_BANKING ab  ) 

Returns a list2 of available importers and exporters. You must free this list after using it via GWEN_PluginDescription_List2_freeAll. Please note that a simple GWEN_PluginDescription_List2_free would not suffice, since that would only free the list but not the objects stored within the list !

Parameters:
ab pointer to the AB_BANKING object

GWEN_DB_NODE* AB_Banking_GetImExporterProfiles ( AB_BANKING ab,
const char *  name 
)

Loads all available profiles for the given importer/exporter. This includes global profiles as well as local ones.

Local profiles overwrite global ones, allowing the user to customize the profiles. Local profiles are expected in a folder below the user local folder (e.g. "$HOME/.banking"). The local profile folder for the CSV plugin is in "$HOME/.banking/imexporters/csv/profiles".

The GWEN_DB returned contains one group for every loaded profile. Every group has the name of the profile it contains. Every group contains at least a variable called name which contains the name of the profile, too. The remaining content of each group is completely defined by the importer/exporter.

You can use GWEN_DB_GetFirstGroup and GWEN_DB_GetNextGroup to browse the profiles.

The caller becomes the new owner of the object returned (if any). This makes him/her responsible for freeing it via GWEN_DB_Group_free.

You can use any of the subgroups below the returned one as argument to AB_ImExporter_Import.

Parameters:
ab pointer to the AB_BANKING object
name name of the importer whose profiles are to be read

int AB_ImExporter_CheckFile ( AB_IMEXPORTER ie,
const char *  fname,
uint32_t  guiid 
)

This function checks whether the given importer supports the given file.

int AB_ImExporter_Export ( AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
GWEN_IO_LAYER *  io,
GWEN_DB_NODE *  dbProfile,
uint32_t  guiid 
)

Writes all data to the given stream.

Parameters:
ie pointer to the importer/exporter
ctx export context
bio stream to write to (usually a file, see GWEN_BufferedIO_File_new)
dbProfile configuration data for the exporter. You can get this using AB_Banking_GetImExporterProfiles.

AB_BANKING* AB_ImExporter_GetBanking ( const AB_IMEXPORTER ie  ) 

Returns the AB_BANKING object to which the im/exporter belongs.

const char* AB_ImExporter_GetName ( const AB_IMEXPORTER ie  ) 

Returns the name of the im/exporter.

int AB_ImExporter_Import ( AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
GWEN_IO_LAYER *  io,
GWEN_DB_NODE *  dbProfile,
uint32_t  guiid 
)

Reads the given stream and imports all data from it. This imported data is stored within the given context.

Parameters:
ie pointer to the importer/exporter
ctx import context
bio stream to read from (usually a file, see GWEN_BufferedIO_File_new)
dbProfile configuration data for the importer. You can get this using AB_Banking_GetImExporterProfiles.

int AB_ImExporter_ImportBuffer ( AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
GWEN_BUFFER *  buf,
GWEN_DB_NODE *  dbProfile,
uint32_t  guiid 
)

int AB_ImExporter_ImportFile ( AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
const char *  fname,
GWEN_DB_NODE *  dbProfile,
uint32_t  guiid 
)

This is just a convenience function for AB_ImExporter_Import.


Generated on Fri Apr 11 03:04:32 2008 for aqbanking by  doxygen 1.5.5