This group contains a generic importer/exporter.
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.
typedef struct AB_IMEXPORTER AB_IMEXPORTER |
Definition at line 49 of file imexporter.h.
typedef struct AB_IMEXPORTER_ACCOUNTINFO AB_IMEXPORTER_ACCOUNTINFO |
Definition at line 53 of file imexporter.h.
typedef struct AB_IMEXPORTER_CONTEXT AB_IMEXPORTER_CONTEXT |
Definition at line 52 of file imexporter.h.
int AB_Banking_FillGapsInImExporterContext | ( | AB_BANKING * | ab, | |
AB_IMEXPORTER_CONTEXT * | iec | |||
) |
This function tries to fill missing fields in a given imexporter context. It tries to find the online banking accounts for all account info objects in the context and copies missing information (like IBAN, BIC, owner name etc).
ab | pointer to the AB_BANKING object | |
iec | pointer to the imexporter context to fill |
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 !
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.
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.
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.
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.