Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

imexporter.h File Reference

#include <gwenhywfar/inherit.h>
#include <gwenhywfar/bufferedio.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/types.h>
#include <aqbanking/error.h>
#include <aqbanking/accstatus.h>
#include <aqbanking/banking.h>
#include <aqbanking/account.h>
#include <aqbanking/transaction.h>

Go to the source code of this file.

Virtual Functions for Backends

int AB_ImExporter_Import (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_BUFFEREDIO *bio, GWEN_DB_NODE *dbProfile)
int AB_ImExporter_Export (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_BUFFEREDIO *bio, GWEN_DB_NODE *dbProfile)
int AB_ImExporter_ImportFile (AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, const char *fname, GWEN_DB_NODE *dbProfile)
int AB_ImExporter_CheckFile (AB_IMEXPORTER *ie, const char *fname)

Im-/export Context

A context contains the list of accounts for which data has been imported or which are to be exported. These accounts each contain a list of imported/to be exported transactions.

AB_IMEXPORTER_CONTEXTAB_ImExporterContext_new ()
void AB_ImExporterContext_free (AB_IMEXPORTER_CONTEXT *iec)
int AB_ImExporterContext_toDb (const AB_IMEXPORTER_CONTEXT *iec, GWEN_DB_NODE *db)
AB_IMEXPORTER_CONTEXTAB_ImExporterContext_fromDb (GWEN_DB_NODE *db)
void AB_ImExporterContext_AddAccountInfo (AB_IMEXPORTER_CONTEXT *iec, AB_IMEXPORTER_ACCOUNTINFO *iea)
AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterContext_GetFirstAccountInfo (AB_IMEXPORTER_CONTEXT *iec)
AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterContext_GetNextAccountInfo (AB_IMEXPORTER_CONTEXT *iec)
AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterContext_FindAccountInfo (AB_IMEXPORTER_CONTEXT *iec, const char *bankCode, const char *accountNumber)
AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterContext_GetAccountInfo (AB_IMEXPORTER_CONTEXT *iec, const char *bankCode, const char *accountNumber)
void AB_ImExporterContext_AddTransaction (AB_IMEXPORTER_CONTEXT *iec, AB_TRANSACTION *t)

Im-/export Account Info

Such a structure contains the list of imported/to be exported transactions for a given account.

AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterAccountInfo_new ()
void AB_ImExporterAccountInfo_free (AB_IMEXPORTER_ACCOUNTINFO *iea)
AB_IMEXPORTER_ACCOUNTINFOAB_ImExporterAccountInfo_dup (const AB_IMEXPORTER_ACCOUNTINFO *oldiea)
void AB_ImExporterAccountInfo_AddTransaction (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_TRANSACTION *t)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetFirstTransaction (AB_IMEXPORTER_ACCOUNTINFO *iea)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetNextTransaction (AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_AddAccountStatus (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_ACCOUNT_STATUS *st)
AB_ACCOUNT_STATUSAB_ImExporterAccountInfo_GetFirstAccountStatus (AB_IMEXPORTER_ACCOUNTINFO *iea)
AB_ACCOUNT_STATUSAB_ImExporterAccountInfo_GetNextAccountStatus (AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_AddStandingOrder (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_TRANSACTION *t)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetFirstStandingOrder (AB_IMEXPORTER_ACCOUNTINFO *iea)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetNextStandingOrder (AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_AddTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_TRANSACTION *t)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetFirstTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetNextTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_AddDatedTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_TRANSACTION *t)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetFirstDatedTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea)
const AB_TRANSACTIONAB_ImExporterAccountInfo_GetNextDatedTransfer (AB_IMEXPORTER_ACCOUNTINFO *iea)
const char * AB_ImExporterAccountInfo_GetBankCode (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetBankCode (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)
const char * AB_ImExporterAccountInfo_GetBankName (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetBankName (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)
const char * AB_ImExporterAccountInfo_GetAccountNumber (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetAccountNumber (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)
const char * AB_ImExporterAccountInfo_GetAccountName (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetAccountName (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)
const char * AB_ImExporterAccountInfo_GetOwner (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetOwner (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)
AB_ACCOUNT_TYPE AB_ImExporterAccountInfo_GetType (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetType (AB_IMEXPORTER_ACCOUNTINFO *iea, AB_ACCOUNT_TYPE t)
const char * AB_ImExporterAccountInfo_GetDescription (const AB_IMEXPORTER_ACCOUNTINFO *iea)
void AB_ImExporterAccountInfo_SetDescription (AB_IMEXPORTER_ACCOUNTINFO *iea, const char *s)

Helper Functions

These functions are most likely used by implementations of im/exporters.

void AB_ImExporter_Utf8ToDta (const char *p, int size, GWEN_BUFFER *buf)
void AB_ImExporter_DtaToUtf8 (const char *p, int size, GWEN_BUFFER *buf)
void AB_ImExporter_Iso8859_1ToUtf8 (const char *p, int size, GWEN_BUFFER *buf)
int AH_ImExporter_DbFromIso8859_1ToUtf8 (GWEN_DB_NODE *db)
GWEN_TIME * AB_ImExporter_DateFromString (const char *p, const char *tmpl, int inUtc)

Typedefs

typedef AB_IMEXPORTER AB_IMEXPORTER
typedef AB_IMEXPORTER_CONTEXT AB_IMEXPORTER_CONTEXT
typedef AB_IMEXPORTER_ACCOUNTINFO AB_IMEXPORTER_ACCOUNTINFO

Functions

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


Function Documentation

int AB_ImExporter_CheckFile AB_IMEXPORTER ie,
const char *  fname
 

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

GWEN_TIME* AB_ImExporter_DateFromString const char *  p,
const char *  tmpl,
int  inUtc
 

void AB_ImExporter_DtaToUtf8 const char *  p,
int  size,
GWEN_BUFFER *  buf
 

Transforms a DTA string to an UTF-8 string.

int AB_ImExporter_Export AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
GWEN_BUFFEREDIO *  bio,
GWEN_DB_NODE *  dbProfile
 

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_BUFFEREDIO *  bio,
GWEN_DB_NODE *  dbProfile
 

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_ImportFile AB_IMEXPORTER ie,
AB_IMEXPORTER_CONTEXT ctx,
const char *  fname,
GWEN_DB_NODE *  dbProfile
 

This is just a convenience function for AB_ImExporter_Import.

void AB_ImExporter_Iso8859_1ToUtf8 const char *  p,
int  size,
GWEN_BUFFER *  buf
 

void AB_ImExporter_Utf8ToDta const char *  p,
int  size,
GWEN_BUFFER *  buf
 

Transforms an UTF-8 string to a DTA string. Untranslateable characters are replaced by a space (chr 32).

void AB_ImExporterAccountInfo_AddAccountStatus AB_IMEXPORTER_ACCOUNTINFO iea,
AB_ACCOUNT_STATUS st
 

Takes over ownership of the given account status.

void AB_ImExporterAccountInfo_AddDatedTransfer AB_IMEXPORTER_ACCOUNTINFO iea,
AB_TRANSACTION t
 

Takes over ownership of the given dated transfer.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

void AB_ImExporterAccountInfo_AddStandingOrder AB_IMEXPORTER_ACCOUNTINFO iea,
AB_TRANSACTION t
 

Takes over ownership of the given standing order.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

void AB_ImExporterAccountInfo_AddTransaction AB_IMEXPORTER_ACCOUNTINFO iea,
AB_TRANSACTION t
 

Takes over ownership of the given transaction.

void AB_ImExporterAccountInfo_AddTransfer AB_IMEXPORTER_ACCOUNTINFO iea,
AB_TRANSACTION t
 

Takes over ownership of the given transfer.

The transfer can be any kind of transfer (like single transfer, debit note, EU transfer etc).

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterAccountInfo_dup const AB_IMEXPORTER_ACCOUNTINFO oldiea  ) 
 

Returns a copy of the given account info. Please note that only the data is copied, internal pointers for AB_ImExporterAccountInfo_GetNextTransaction et al are reset in the copy.

void AB_ImExporterAccountInfo_free AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

const char* AB_ImExporterAccountInfo_GetAccountName const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Account name. Used when importing data, not used when exporting.

const char* AB_ImExporterAccountInfo_GetAccountNumber const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Account number. Used when importing data, not used when exporting.

const char* AB_ImExporterAccountInfo_GetBankCode const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Bank code of the institute the account is at.

const char* AB_ImExporterAccountInfo_GetBankName const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Bank name of the institute the account is at.

const char* AB_ImExporterAccountInfo_GetDescription const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

AB_ACCOUNT_STATUS* AB_ImExporterAccountInfo_GetFirstAccountStatus AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the first account status stored within the context. The caller becomes the new owner of the account status returned (if any) which makes him/her responsible for freeing it using AB_AccountStatus_free.

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetFirstDatedTransfer AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the first dated transfer stored within the context. The context remains the owner of the object returned.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetFirstStandingOrder AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the first standing order stored within the context. The context remains the owner of the object returned.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetFirstTransaction AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the first transaction stored within the context. The context remains the owner of the object returned.

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetFirstTransfer AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the first transfer stored within the context. The context remains the owner of the object returned. The transfer can be any kind of transfer (like single transfer, debit note, EU transfer etc).

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

AB_ACCOUNT_STATUS* AB_ImExporterAccountInfo_GetNextAccountStatus AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the next account status stored within the context. The caller becomes the new owner of the account status returned (if any) which makes him/her responsible for freeing it using AB_AccountStatus_free.

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetNextDatedTransfer AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the next dated transfer stored within the context. The context remains the owner of the object returned.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetNextStandingOrder AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the next standing order stored within the context. The context remains the owner of the object returned.

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetNextTransaction AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the next transaction stored within the context. The context remains the owner of the object returned.

const AB_TRANSACTION* AB_ImExporterAccountInfo_GetNextTransfer AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Returns the next transfer stored within the context. The context remains the owner of the object returned. The transfer can be any kind of transfer (like single transfer, debit note, EU transfer etc).

This function is only used in the context of the function AB_Banking_GatherResponses. It is especially not used when importing or exporting normal transactions via AB_ImExporter_Import or AB_ImExporter_Export unless explicitly stated otherwise (see documentation of the importer/exporter in question).

const char* AB_ImExporterAccountInfo_GetOwner const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

Name of the account' owner. Used when importing data, not used when exporting.

AB_ACCOUNT_TYPE AB_ImExporterAccountInfo_GetType const AB_IMEXPORTER_ACCOUNTINFO iea  ) 
 

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterAccountInfo_new  ) 
 

void AB_ImExporterAccountInfo_SetAccountName AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetAccountNumber AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetBankCode AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetBankName AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetDescription AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetOwner AB_IMEXPORTER_ACCOUNTINFO iea,
const char *  s
 

void AB_ImExporterAccountInfo_SetType AB_IMEXPORTER_ACCOUNTINFO iea,
AB_ACCOUNT_TYPE  t
 

void AB_ImExporterContext_AddAccountInfo AB_IMEXPORTER_CONTEXT iec,
AB_IMEXPORTER_ACCOUNTINFO iea
 

Takes over ownership of the given account info.

void AB_ImExporterContext_AddTransaction AB_IMEXPORTER_CONTEXT iec,
AB_TRANSACTION t
 

This is just a convenience function. It takes the bank code and account number from the account, and then calls AB_ImExporterContext_GetAccountInfo and AB_ImExporterAccountInfo_AddTransaction. If you want to add many transactions which are sorted by account it is much faster to avoid this function and to select the appropriate account info object once before importing all transactions for this particular account. This would save you the additional lookup before every transaction.

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterContext_FindAccountInfo AB_IMEXPORTER_CONTEXT iec,
const char *  bankCode,
const char *  accountNumber
 

Looks for account info for the given account. If it is not found 0 is returned. The context remains the owner of the returned object.

void AB_ImExporterContext_free AB_IMEXPORTER_CONTEXT iec  ) 
 

AB_IMEXPORTER_CONTEXT* AB_ImExporterContext_fromDb GWEN_DB_NODE *  db  ) 
 

Restores a complete import/export context from a GWEN_DB.

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterContext_GetAccountInfo AB_IMEXPORTER_CONTEXT iec,
const char *  bankCode,
const char *  accountNumber
 

Looks for account info for the given account. If there is none it will be created and added to the context. The context remains the owner of the returned object.

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterContext_GetFirstAccountInfo AB_IMEXPORTER_CONTEXT iec  ) 
 

Returns the first imported account (if any). The context remains the owner of the object returned.

AB_IMEXPORTER_ACCOUNTINFO* AB_ImExporterContext_GetNextAccountInfo AB_IMEXPORTER_CONTEXT iec  ) 
 

Returns the next account data has been imported for. The context remains the owner of the object returned.

AB_IMEXPORTER_CONTEXT* AB_ImExporterContext_new  ) 
 

int AB_ImExporterContext_toDb const AB_IMEXPORTER_CONTEXT iec,
GWEN_DB_NODE *  db
 

Stores a complete import/export context to a GWEN_DB.

int AH_ImExporter_DbFromIso8859_1ToUtf8 GWEN_DB_NODE *  db  ) 
 

This function call AB_ImExporter_Iso8859_1ToUtf8 on all char values in the given db.


Generated on Thu Oct 6 14:49:09 2005 for aqbanking by  doxygen 1.4.4