/**********************************************************
 * This file has been automatically created by "typemaker2"
 * from the file "imexporter_accountinfo.xml".
 * Please do not edit this file, all changes will be lost.
 * Better edit the mentioned source file instead.
 **********************************************************/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "./imexporter_accountinfo_p.h"

#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>

/* code headers */

/* macro functions */
GWEN_LIST_FUNCTIONS(AB_IMEXPORTER_ACCOUNTINFO, AB_ImExporterAccountInfo)
GWEN_LIST2_FUNCTIONS(AB_IMEXPORTER_ACCOUNTINFO, AB_ImExporterAccountInfo)


AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_new(void) {
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;

  GWEN_NEW_OBJECT(AB_IMEXPORTER_ACCOUNTINFO, p_struct)
  p_struct->_refCount=1;
  GWEN_LIST_INIT(AB_IMEXPORTER_ACCOUNTINFO, p_struct)
  /* members */
  p_struct->country=NULL;
  p_struct->bankCode=NULL;
  p_struct->bankName=NULL;
  p_struct->accountNumber=NULL;
  p_struct->subAccountId=NULL;
  p_struct->accountName=NULL;
  p_struct->iban=NULL;
  p_struct->bic=NULL;
  p_struct->owner=NULL;
  p_struct->currency=NULL;
  p_struct->description=NULL;
  p_struct->accountType=0;
  p_struct->accountId=0;
  p_struct->balanceList=AB_Balance_List_new();
  p_struct->transactionList=AB_Transaction_List_new();
  p_struct->eStatementList=AB_Document_List_new();
  /* virtual functions */

  return p_struct;
}

void AB_ImExporterAccountInfo_free(AB_IMEXPORTER_ACCOUNTINFO *p_struct) {
  if (p_struct) {
  assert(p_struct->_refCount);
  if (p_struct->_refCount==1) {
    GWEN_LIST_FINI(AB_IMEXPORTER_ACCOUNTINFO, p_struct)
  /* members */
    free(p_struct->country); p_struct->country=NULL;
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    free(p_struct->bankName); p_struct->bankName=NULL;
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    free(p_struct->accountName); p_struct->accountName=NULL;
    free(p_struct->iban); p_struct->iban=NULL;
    free(p_struct->bic); p_struct->bic=NULL;
    free(p_struct->owner); p_struct->owner=NULL;
    free(p_struct->currency); p_struct->currency=NULL;
    free(p_struct->description); p_struct->description=NULL;
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->_refCount=0;
    GWEN_FREE_OBJECT(p_struct);
  }
  else
    p_struct->_refCount--;
  }
}

void AB_ImExporterAccountInfo_Attach(AB_IMEXPORTER_ACCOUNTINFO *p_struct) {
  assert(p_struct);
  assert(p_struct->_refCount);
  p_struct->_refCount++;
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_dup(const AB_IMEXPORTER_ACCOUNTINFO *p_src) {
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;

  assert(p_src);
  p_struct=AB_ImExporterAccountInfo_new();
  /* member "country" */
  if (p_struct->country) {
    free(p_struct->country); p_struct->country=NULL;
    p_struct->country=NULL;
  }
  if (p_src->country) {
    p_struct->country=strdup(p_src->country);
  }


  /* member "bankCode" */
  if (p_struct->bankCode) {
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    p_struct->bankCode=NULL;
  }
  if (p_src->bankCode) {
    p_struct->bankCode=strdup(p_src->bankCode);
  }


  /* member "bankName" */
  if (p_struct->bankName) {
    free(p_struct->bankName); p_struct->bankName=NULL;
    p_struct->bankName=NULL;
  }
  if (p_src->bankName) {
    p_struct->bankName=strdup(p_src->bankName);
  }


  /* member "accountNumber" */
  if (p_struct->accountNumber) {
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    p_struct->accountNumber=NULL;
  }
  if (p_src->accountNumber) {
    p_struct->accountNumber=strdup(p_src->accountNumber);
  }


  /* member "subAccountId" */
  if (p_struct->subAccountId) {
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    p_struct->subAccountId=NULL;
  }
  if (p_src->subAccountId) {
    p_struct->subAccountId=strdup(p_src->subAccountId);
  }


  /* member "accountName" */
  if (p_struct->accountName) {
    free(p_struct->accountName); p_struct->accountName=NULL;
    p_struct->accountName=NULL;
  }
  if (p_src->accountName) {
    p_struct->accountName=strdup(p_src->accountName);
  }


  /* member "iban" */
  if (p_struct->iban) {
    free(p_struct->iban); p_struct->iban=NULL;
    p_struct->iban=NULL;
  }
  if (p_src->iban) {
    p_struct->iban=strdup(p_src->iban);
  }


  /* member "bic" */
  if (p_struct->bic) {
    free(p_struct->bic); p_struct->bic=NULL;
    p_struct->bic=NULL;
  }
  if (p_src->bic) {
    p_struct->bic=strdup(p_src->bic);
  }


  /* member "owner" */
  if (p_struct->owner) {
    free(p_struct->owner); p_struct->owner=NULL;
    p_struct->owner=NULL;
  }
  if (p_src->owner) {
    p_struct->owner=strdup(p_src->owner);
  }


  /* member "currency" */
  if (p_struct->currency) {
    free(p_struct->currency); p_struct->currency=NULL;
    p_struct->currency=NULL;
  }
  if (p_src->currency) {
    p_struct->currency=strdup(p_src->currency);
  }


  /* member "description" */
  if (p_struct->description) {
    free(p_struct->description); p_struct->description=NULL;
    p_struct->description=NULL;
  }
  if (p_src->description) {
    p_struct->description=strdup(p_src->description);
  }


  /* member "accountType" */
    p_struct->accountType=p_src->accountType;


  /* member "accountId" */
    p_struct->accountId=p_src->accountId;


  /* member "balanceList" */
  if (p_struct->balanceList) {
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    p_struct->balanceList=NULL;
  }
  if (p_src->balanceList) {
    p_struct->balanceList=AB_Balance_List_dup(p_src->balanceList);
  }


  /* member "transactionList" */
  if (p_struct->transactionList) {
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    p_struct->transactionList=NULL;
  }
  if (p_src->transactionList) {
    p_struct->transactionList=AB_Transaction_List_dup(p_src->transactionList);
  }


  /* member "eStatementList" */
  if (p_struct->eStatementList) {
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->eStatementList=NULL;
  }
  if (p_src->eStatementList) {
    p_struct->eStatementList=AB_Document_List_dup(p_src->eStatementList);
  }


  return p_struct;
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_copy(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const AB_IMEXPORTER_ACCOUNTINFO *p_src) {
  assert(p_struct);
  assert(p_src);
  /* member "country" */
  if (p_struct->country) {
    free(p_struct->country); p_struct->country=NULL;
    p_struct->country=NULL;
  }
  if (p_src->country) {
    p_struct->country=strdup(p_src->country);
  }


  /* member "bankCode" */
  if (p_struct->bankCode) {
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    p_struct->bankCode=NULL;
  }
  if (p_src->bankCode) {
    p_struct->bankCode=strdup(p_src->bankCode);
  }


  /* member "bankName" */
  if (p_struct->bankName) {
    free(p_struct->bankName); p_struct->bankName=NULL;
    p_struct->bankName=NULL;
  }
  if (p_src->bankName) {
    p_struct->bankName=strdup(p_src->bankName);
  }


  /* member "accountNumber" */
  if (p_struct->accountNumber) {
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    p_struct->accountNumber=NULL;
  }
  if (p_src->accountNumber) {
    p_struct->accountNumber=strdup(p_src->accountNumber);
  }


  /* member "subAccountId" */
  if (p_struct->subAccountId) {
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    p_struct->subAccountId=NULL;
  }
  if (p_src->subAccountId) {
    p_struct->subAccountId=strdup(p_src->subAccountId);
  }


  /* member "accountName" */
  if (p_struct->accountName) {
    free(p_struct->accountName); p_struct->accountName=NULL;
    p_struct->accountName=NULL;
  }
  if (p_src->accountName) {
    p_struct->accountName=strdup(p_src->accountName);
  }


  /* member "iban" */
  if (p_struct->iban) {
    free(p_struct->iban); p_struct->iban=NULL;
    p_struct->iban=NULL;
  }
  if (p_src->iban) {
    p_struct->iban=strdup(p_src->iban);
  }


  /* member "bic" */
  if (p_struct->bic) {
    free(p_struct->bic); p_struct->bic=NULL;
    p_struct->bic=NULL;
  }
  if (p_src->bic) {
    p_struct->bic=strdup(p_src->bic);
  }


  /* member "owner" */
  if (p_struct->owner) {
    free(p_struct->owner); p_struct->owner=NULL;
    p_struct->owner=NULL;
  }
  if (p_src->owner) {
    p_struct->owner=strdup(p_src->owner);
  }


  /* member "currency" */
  if (p_struct->currency) {
    free(p_struct->currency); p_struct->currency=NULL;
    p_struct->currency=NULL;
  }
  if (p_src->currency) {
    p_struct->currency=strdup(p_src->currency);
  }


  /* member "description" */
  if (p_struct->description) {
    free(p_struct->description); p_struct->description=NULL;
    p_struct->description=NULL;
  }
  if (p_src->description) {
    p_struct->description=strdup(p_src->description);
  }


  /* member "accountType" */
    p_struct->accountType=p_src->accountType;


  /* member "accountId" */
    p_struct->accountId=p_src->accountId;


  /* member "balanceList" */
  if (p_struct->balanceList) {
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    p_struct->balanceList=NULL;
  }
  if (p_src->balanceList) {
    p_struct->balanceList=AB_Balance_List_dup(p_src->balanceList);
  }


  /* member "transactionList" */
  if (p_struct->transactionList) {
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    p_struct->transactionList=NULL;
  }
  if (p_src->transactionList) {
    p_struct->transactionList=AB_Transaction_List_dup(p_src->transactionList);
  }


  /* member "eStatementList" */
  if (p_struct->eStatementList) {
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->eStatementList=NULL;
  }
  if (p_src->eStatementList) {
    p_struct->eStatementList=AB_Document_List_dup(p_src->eStatementList);
  }


  return p_struct;
}

const char *AB_ImExporterAccountInfo_GetCountry(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->country;
}

const char *AB_ImExporterAccountInfo_GetBankCode(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->bankCode;
}

const char *AB_ImExporterAccountInfo_GetBankName(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->bankName;
}

const char *AB_ImExporterAccountInfo_GetAccountNumber(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->accountNumber;
}

const char *AB_ImExporterAccountInfo_GetSubAccountId(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->subAccountId;
}

const char *AB_ImExporterAccountInfo_GetAccountName(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->accountName;
}

const char *AB_ImExporterAccountInfo_GetIban(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->iban;
}

const char *AB_ImExporterAccountInfo_GetBic(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->bic;
}

const char *AB_ImExporterAccountInfo_GetOwner(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->owner;
}

const char *AB_ImExporterAccountInfo_GetCurrency(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->currency;
}

const char *AB_ImExporterAccountInfo_GetDescription(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->description;
}

int AB_ImExporterAccountInfo_GetAccountType(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->accountType;
}

uint32_t AB_ImExporterAccountInfo_GetAccountId(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->accountId;
}

AB_BALANCE_LIST *AB_ImExporterAccountInfo_GetBalanceList(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->balanceList;
}

AB_TRANSACTION_LIST *AB_ImExporterAccountInfo_GetTransactionList(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->transactionList;
}

AB_DOCUMENT_LIST *AB_ImExporterAccountInfo_GetEStatementList(const AB_IMEXPORTER_ACCOUNTINFO *p_struct){
  assert(p_struct);
  return p_struct->eStatementList;
}

void AB_ImExporterAccountInfo_SetCountry(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->country) {
    free(p_struct->country); p_struct->country=NULL;
    p_struct->country=NULL;
  }
  if (p_src) {
    p_struct->country=strdup(p_src);
  }
  else {
    p_struct->country=NULL;
  }

}

void AB_ImExporterAccountInfo_SetBankCode(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->bankCode) {
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    p_struct->bankCode=NULL;
  }
  if (p_src) {
    p_struct->bankCode=strdup(p_src);
  }
  else {
    p_struct->bankCode=NULL;
  }

}

void AB_ImExporterAccountInfo_SetBankName(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->bankName) {
    free(p_struct->bankName); p_struct->bankName=NULL;
    p_struct->bankName=NULL;
  }
  if (p_src) {
    p_struct->bankName=strdup(p_src);
  }
  else {
    p_struct->bankName=NULL;
  }

}

void AB_ImExporterAccountInfo_SetAccountNumber(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->accountNumber) {
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    p_struct->accountNumber=NULL;
  }
  if (p_src) {
    p_struct->accountNumber=strdup(p_src);
  }
  else {
    p_struct->accountNumber=NULL;
  }

}

void AB_ImExporterAccountInfo_SetSubAccountId(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->subAccountId) {
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    p_struct->subAccountId=NULL;
  }
  if (p_src) {
    p_struct->subAccountId=strdup(p_src);
  }
  else {
    p_struct->subAccountId=NULL;
  }

}

void AB_ImExporterAccountInfo_SetAccountName(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->accountName) {
    free(p_struct->accountName); p_struct->accountName=NULL;
    p_struct->accountName=NULL;
  }
  if (p_src) {
    p_struct->accountName=strdup(p_src);
  }
  else {
    p_struct->accountName=NULL;
  }

}

void AB_ImExporterAccountInfo_SetIban(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->iban) {
    free(p_struct->iban); p_struct->iban=NULL;
    p_struct->iban=NULL;
  }
  if (p_src) {
    p_struct->iban=strdup(p_src);
  }
  else {
    p_struct->iban=NULL;
  }

}

void AB_ImExporterAccountInfo_SetBic(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->bic) {
    free(p_struct->bic); p_struct->bic=NULL;
    p_struct->bic=NULL;
  }
  if (p_src) {
    p_struct->bic=strdup(p_src);
  }
  else {
    p_struct->bic=NULL;
  }

}

void AB_ImExporterAccountInfo_SetOwner(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->owner) {
    free(p_struct->owner); p_struct->owner=NULL;
    p_struct->owner=NULL;
  }
  if (p_src) {
    p_struct->owner=strdup(p_src);
  }
  else {
    p_struct->owner=NULL;
  }

}

void AB_ImExporterAccountInfo_SetCurrency(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->currency) {
    free(p_struct->currency); p_struct->currency=NULL;
    p_struct->currency=NULL;
  }
  if (p_src) {
    p_struct->currency=strdup(p_src);
  }
  else {
    p_struct->currency=NULL;
  }

}

void AB_ImExporterAccountInfo_SetDescription(AB_IMEXPORTER_ACCOUNTINFO *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->description) {
    free(p_struct->description); p_struct->description=NULL;
    p_struct->description=NULL;
  }
  if (p_src) {
    p_struct->description=strdup(p_src);
  }
  else {
    p_struct->description=NULL;
  }

}

void AB_ImExporterAccountInfo_SetAccountType(AB_IMEXPORTER_ACCOUNTINFO *p_struct, int p_src){
  assert(p_struct);
  p_struct->accountType=p_src;
}

void AB_ImExporterAccountInfo_SetAccountId(AB_IMEXPORTER_ACCOUNTINFO *p_struct, uint32_t p_src){
  assert(p_struct);
  p_struct->accountId=p_src;
}

void AB_ImExporterAccountInfo_SetBalanceList(AB_IMEXPORTER_ACCOUNTINFO *p_struct, AB_BALANCE_LIST *p_src){
  assert(p_struct);
  if (p_struct->balanceList) {
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    p_struct->balanceList=NULL;
  }
  p_struct->balanceList=p_src;
}

void AB_ImExporterAccountInfo_SetTransactionList(AB_IMEXPORTER_ACCOUNTINFO *p_struct, AB_TRANSACTION_LIST *p_src){
  assert(p_struct);
  if (p_struct->transactionList) {
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    p_struct->transactionList=NULL;
  }
  p_struct->transactionList=p_src;
}

void AB_ImExporterAccountInfo_SetEStatementList(AB_IMEXPORTER_ACCOUNTINFO *p_struct, AB_DOCUMENT_LIST *p_src){
  assert(p_struct);
  if (p_struct->eStatementList) {
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->eStatementList=NULL;
  }
  p_struct->eStatementList=p_src;
}

AB_IMEXPORTER_ACCOUNTINFO_LIST *AB_ImExporterAccountInfo_List_dup(const AB_IMEXPORTER_ACCOUNTINFO_LIST *p_src) {
  AB_IMEXPORTER_ACCOUNTINFO_LIST *p_dest;
  AB_IMEXPORTER_ACCOUNTINFO *p_elem;

  assert(p_src);
  p_dest=AB_ImExporterAccountInfo_List_new();
  p_elem=AB_ImExporterAccountInfo_List_First(p_src);
  while(p_elem) {
    AB_IMEXPORTER_ACCOUNTINFO *p_cpy;

    p_cpy=AB_ImExporterAccountInfo_dup(p_elem);
    AB_ImExporterAccountInfo_List_Add(p_cpy, p_dest);
    p_elem=AB_ImExporterAccountInfo_List_Next(p_elem);
  }

  return p_dest;
}

void AB_ImExporterAccountInfo_ReadDb(AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_DB_NODE *p_db){
  assert(p_struct);
  /* member "country" */
  if (p_struct->country) {
    free(p_struct->country); p_struct->country=NULL;
    p_struct->country=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "country", 0, NULL); if (s) p_struct->country=strdup(s); }
  /* member "bankCode" */
  if (p_struct->bankCode) {
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    p_struct->bankCode=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "bankCode", 0, NULL); if (s) p_struct->bankCode=strdup(s); }
  /* member "bankName" */
  if (p_struct->bankName) {
    free(p_struct->bankName); p_struct->bankName=NULL;
    p_struct->bankName=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "bankName", 0, NULL); if (s) p_struct->bankName=strdup(s); }
  /* member "accountNumber" */
  if (p_struct->accountNumber) {
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    p_struct->accountNumber=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "accountNumber", 0, NULL); if (s) p_struct->accountNumber=strdup(s); }
  /* member "subAccountId" */
  if (p_struct->subAccountId) {
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    p_struct->subAccountId=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "subAccountId", 0, NULL); if (s) p_struct->subAccountId=strdup(s); }
  /* member "accountName" */
  if (p_struct->accountName) {
    free(p_struct->accountName); p_struct->accountName=NULL;
    p_struct->accountName=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "accountName", 0, NULL); if (s) p_struct->accountName=strdup(s); }
  /* member "iban" */
  if (p_struct->iban) {
    free(p_struct->iban); p_struct->iban=NULL;
    p_struct->iban=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "iban", 0, NULL); if (s) p_struct->iban=strdup(s); }
  /* member "bic" */
  if (p_struct->bic) {
    free(p_struct->bic); p_struct->bic=NULL;
    p_struct->bic=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "bic", 0, NULL); if (s) p_struct->bic=strdup(s); }
  /* member "owner" */
  if (p_struct->owner) {
    free(p_struct->owner); p_struct->owner=NULL;
    p_struct->owner=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "owner", 0, NULL); if (s) p_struct->owner=strdup(s); }
  /* member "currency" */
  if (p_struct->currency) {
    free(p_struct->currency); p_struct->currency=NULL;
    p_struct->currency=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "currency", 0, NULL); if (s) p_struct->currency=strdup(s); }
  /* member "description" */
  if (p_struct->description) {
    free(p_struct->description); p_struct->description=NULL;
    p_struct->description=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "description", 0, NULL); if (s) p_struct->description=strdup(s); }
  /* member "accountType" */
  p_struct->accountType=GWEN_DB_GetIntValue(p_db, "accountType", 0, 0);
  /* member "accountId" */
  p_struct->accountId=GWEN_DB_GetIntValue(p_db, "accountId", 0, 0);
  /* member "balanceList" */
  if (p_struct->balanceList) {
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    p_struct->balanceList=NULL;
  }
  { GWEN_DB_NODE *dbSource; dbSource=GWEN_DB_GetGroup(p_db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "balanceList"); if (dbSource) { AB_BALANCE_LIST *t; GWEN_DB_NODE *dbT; t=AB_Balance_List_new(); dbT=GWEN_DB_FindFirstGroup(dbSource, "balance"); while(dbT) { AB_BALANCE *elem; elem=AB_Balance_fromDb(dbT); if (elem) AB_Balance_List_Add(elem, t); dbT=GWEN_DB_FindNextGroup(dbT, "balance"); } p_struct->balanceList=t; } else p_struct->balanceList=AB_Balance_List_new(); }
  /* member "transactionList" */
  if (p_struct->transactionList) {
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    p_struct->transactionList=NULL;
  }
  { GWEN_DB_NODE *dbSource; dbSource=GWEN_DB_GetGroup(p_db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "transactionList"); if (dbSource) { AB_TRANSACTION_LIST *t; GWEN_DB_NODE *dbT; t=AB_Transaction_List_new(); dbT=GWEN_DB_FindFirstGroup(dbSource, "transaction"); while(dbT) { AB_TRANSACTION *elem; elem=AB_Transaction_fromDb(dbT); if (elem) AB_Transaction_List_Add(elem, t); dbT=GWEN_DB_FindNextGroup(dbT, "transaction"); } p_struct->transactionList=t; } else p_struct->transactionList=AB_Transaction_List_new(); }
  /* member "eStatementList" */
  if (p_struct->eStatementList) {
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->eStatementList=NULL;
  }
  { GWEN_DB_NODE *dbSource; dbSource=GWEN_DB_GetGroup(p_db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "eStatementList"); if (dbSource) { AB_DOCUMENT_LIST *t; GWEN_DB_NODE *dbT; t=AB_Document_List_new(); dbT=GWEN_DB_FindFirstGroup(dbSource, "eStatement"); while(dbT) { AB_DOCUMENT *elem; elem=AB_Document_fromDb(dbT); if (elem) AB_Document_List_Add(elem, t); dbT=GWEN_DB_FindNextGroup(dbT, "eStatement"); } p_struct->eStatementList=t; } else p_struct->eStatementList=AB_Document_List_new(); }
}

int AB_ImExporterAccountInfo_WriteDb(const AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_DB_NODE *p_db) {
  int p_rv;

  assert(p_struct);
  /* member "country" */
  if (p_struct->country) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "country", p_struct->country); else { GWEN_DB_DeleteVar(p_db, "country"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "bankCode" */
  if (p_struct->bankCode) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bankCode", p_struct->bankCode); else { GWEN_DB_DeleteVar(p_db, "bankCode"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "bankName" */
  if (p_struct->bankName) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bankName", p_struct->bankName); else { GWEN_DB_DeleteVar(p_db, "bankName"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "accountNumber" */
  if (p_struct->accountNumber) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountNumber", p_struct->accountNumber); else { GWEN_DB_DeleteVar(p_db, "accountNumber"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "subAccountId" */
  if (p_struct->subAccountId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "subAccountId", p_struct->subAccountId); else { GWEN_DB_DeleteVar(p_db, "subAccountId"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "accountName" */
  if (p_struct->accountName) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountName", p_struct->accountName); else { GWEN_DB_DeleteVar(p_db, "accountName"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "iban" */
  if (p_struct->iban) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "iban", p_struct->iban); else { GWEN_DB_DeleteVar(p_db, "iban"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "bic" */
  if (p_struct->bic) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bic", p_struct->bic); else { GWEN_DB_DeleteVar(p_db, "bic"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "owner" */
  if (p_struct->owner) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "owner", p_struct->owner); else { GWEN_DB_DeleteVar(p_db, "owner"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "currency" */
  if (p_struct->currency) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "currency", p_struct->currency); else { GWEN_DB_DeleteVar(p_db, "currency"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "description" */
  if (p_struct->description) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "description", p_struct->description); else { GWEN_DB_DeleteVar(p_db, "description"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "accountType" */
  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountType", p_struct->accountType);
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "accountId" */
  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountId", p_struct->accountId);
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "balanceList" */
  { if (p_struct->balanceList) { GWEN_DB_NODE *dbDest; AB_BALANCE *elem; dbDest=GWEN_DB_GetGroup(p_db, GWEN_DB_FLAGS_OVERWRITE_GROUPS, "balanceList"); assert(dbDest); p_rv=0; elem=AB_Balance_List_First(p_struct->balanceList); while(elem) { GWEN_DB_NODE *dbElem; dbElem=GWEN_DB_GetGroup(dbDest, GWEN_PATH_FLAGS_CREATE_GROUP, "balance"); assert(dbElem); p_rv=AB_Balance_toDb(elem, dbElem); if (p_rv<0) { DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", p_rv); break; } elem=AB_Balance_List_Next(elem); } } else p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "transactionList" */
  { if (p_struct->transactionList) { GWEN_DB_NODE *dbDest; AB_TRANSACTION *elem; dbDest=GWEN_DB_GetGroup(p_db, GWEN_DB_FLAGS_OVERWRITE_GROUPS, "transactionList"); assert(dbDest); p_rv=0; elem=AB_Transaction_List_First(p_struct->transactionList); while(elem) { GWEN_DB_NODE *dbElem; dbElem=GWEN_DB_GetGroup(dbDest, GWEN_PATH_FLAGS_CREATE_GROUP, "transaction"); assert(dbElem); p_rv=AB_Transaction_toDb(elem, dbElem); if (p_rv<0) { DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", p_rv); break; } elem=AB_Transaction_List_Next(elem); } } else p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "eStatementList" */
  { if (p_struct->eStatementList) { GWEN_DB_NODE *dbDest; AB_DOCUMENT *elem; dbDest=GWEN_DB_GetGroup(p_db, GWEN_DB_FLAGS_OVERWRITE_GROUPS, "eStatementList"); assert(dbDest); p_rv=0; elem=AB_Document_List_First(p_struct->eStatementList); while(elem) { GWEN_DB_NODE *dbElem; dbElem=GWEN_DB_GetGroup(dbDest, GWEN_PATH_FLAGS_CREATE_GROUP, "eStatement"); assert(dbElem); p_rv=AB_Document_toDb(elem, dbElem); if (p_rv<0) { DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", p_rv); break; } elem=AB_Document_List_Next(elem); } } else p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  return 0;
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_fromDb(GWEN_DB_NODE *p_db) {
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;
  p_struct=AB_ImExporterAccountInfo_new();
  AB_ImExporterAccountInfo_ReadDb(p_struct, p_db);
  return p_struct;
}

int AB_ImExporterAccountInfo_toDb(const AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_DB_NODE *p_db) {
  return AB_ImExporterAccountInfo_WriteDb(p_struct, p_db);
}

void AB_ImExporterAccountInfo_ReadXml(AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_XMLNODE *p_db){
  assert(p_struct);
  /* member "country" */
  if (p_struct->country) {
    free(p_struct->country); p_struct->country=NULL;
    p_struct->country=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "country", NULL); if (s) p_struct->country=strdup(s); }
  /* member "bankCode" */
  if (p_struct->bankCode) {
    free(p_struct->bankCode); p_struct->bankCode=NULL;
    p_struct->bankCode=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "bankCode", NULL); if (s) p_struct->bankCode=strdup(s); }
  /* member "bankName" */
  if (p_struct->bankName) {
    free(p_struct->bankName); p_struct->bankName=NULL;
    p_struct->bankName=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "bankName", NULL); if (s) p_struct->bankName=strdup(s); }
  /* member "accountNumber" */
  if (p_struct->accountNumber) {
    free(p_struct->accountNumber); p_struct->accountNumber=NULL;
    p_struct->accountNumber=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "accountNumber", NULL); if (s) p_struct->accountNumber=strdup(s); }
  /* member "subAccountId" */
  if (p_struct->subAccountId) {
    free(p_struct->subAccountId); p_struct->subAccountId=NULL;
    p_struct->subAccountId=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "subAccountId", NULL); if (s) p_struct->subAccountId=strdup(s); }
  /* member "accountName" */
  if (p_struct->accountName) {
    free(p_struct->accountName); p_struct->accountName=NULL;
    p_struct->accountName=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "accountName", NULL); if (s) p_struct->accountName=strdup(s); }
  /* member "iban" */
  if (p_struct->iban) {
    free(p_struct->iban); p_struct->iban=NULL;
    p_struct->iban=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "iban", NULL); if (s) p_struct->iban=strdup(s); }
  /* member "bic" */
  if (p_struct->bic) {
    free(p_struct->bic); p_struct->bic=NULL;
    p_struct->bic=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "bic", NULL); if (s) p_struct->bic=strdup(s); }
  /* member "owner" */
  if (p_struct->owner) {
    free(p_struct->owner); p_struct->owner=NULL;
    p_struct->owner=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "owner", NULL); if (s) p_struct->owner=strdup(s); }
  /* member "currency" */
  if (p_struct->currency) {
    free(p_struct->currency); p_struct->currency=NULL;
    p_struct->currency=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "currency", NULL); if (s) p_struct->currency=strdup(s); }
  /* member "description" */
  if (p_struct->description) {
    free(p_struct->description); p_struct->description=NULL;
    p_struct->description=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "description", NULL); if (s) p_struct->description=strdup(s); }
  /* member "accountType" */
  p_struct->accountType=GWEN_XMLNode_GetIntValue(p_db, "accountType", 0);
  /* member "accountId" */
  p_struct->accountId=GWEN_XMLNode_GetIntValue(p_db, "accountId", 0);
  /* member "balanceList" */
  if (p_struct->balanceList) {
    AB_Balance_List_free(p_struct->balanceList); p_struct->balanceList=NULL;
    p_struct->balanceList=NULL;
  }
  { GWEN_XMLNODE *dbSource; dbSource=GWEN_XMLNode_FindFirstTag(p_db, "balanceList", NULL, NULL); if (dbSource) { AB_BALANCE_LIST *t; GWEN_XMLNODE *dbT; t=AB_Balance_List_new(); dbT=GWEN_XMLNode_FindFirstTag(dbSource, "balance", NULL, NULL); while(dbT) { AB_BALANCE *elem; elem=AB_Balance_fromXml(dbT); if (elem) AB_Balance_List_Add(elem, t); dbT=GWEN_XMLNode_FindNextTag(dbT, "balance", NULL, NULL); } p_struct->balanceList=t; } else p_struct->balanceList=AB_Balance_List_new(); }
  /* member "transactionList" */
  if (p_struct->transactionList) {
    AB_Transaction_List_free(p_struct->transactionList); p_struct->transactionList=NULL;
    p_struct->transactionList=NULL;
  }
  { GWEN_XMLNODE *dbSource; dbSource=GWEN_XMLNode_FindFirstTag(p_db, "transactionList", NULL, NULL); if (dbSource) { AB_TRANSACTION_LIST *t; GWEN_XMLNODE *dbT; t=AB_Transaction_List_new(); dbT=GWEN_XMLNode_FindFirstTag(dbSource, "transaction", NULL, NULL); while(dbT) { AB_TRANSACTION *elem; elem=AB_Transaction_fromXml(dbT); if (elem) AB_Transaction_List_Add(elem, t); dbT=GWEN_XMLNode_FindNextTag(dbT, "transaction", NULL, NULL); } p_struct->transactionList=t; } else p_struct->transactionList=AB_Transaction_List_new(); }
  /* member "eStatementList" */
  if (p_struct->eStatementList) {
    AB_Document_List_free(p_struct->eStatementList); p_struct->eStatementList=NULL;
    p_struct->eStatementList=NULL;
  }
  { GWEN_XMLNODE *dbSource; dbSource=GWEN_XMLNode_FindFirstTag(p_db, "eStatementList", NULL, NULL); if (dbSource) { AB_DOCUMENT_LIST *t; GWEN_XMLNODE *dbT; t=AB_Document_List_new(); dbT=GWEN_XMLNode_FindFirstTag(dbSource, "eStatement", NULL, NULL); while(dbT) { AB_DOCUMENT *elem; elem=AB_Document_fromXml(dbT); if (elem) AB_Document_List_Add(elem, t); dbT=GWEN_XMLNode_FindNextTag(dbT, "eStatement", NULL, NULL); } p_struct->eStatementList=t; } else p_struct->eStatementList=AB_Document_List_new(); }
}

void AB_ImExporterAccountInfo_WriteXml(const AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_XMLNODE *p_db) {
  assert(p_struct);
  /* member "country" */
  GWEN_XMLNode_SetCharValue(p_db, "country", p_struct->country);


  /* member "bankCode" */
  GWEN_XMLNode_SetCharValue(p_db, "bankCode", p_struct->bankCode);


  /* member "bankName" */
  GWEN_XMLNode_SetCharValue(p_db, "bankName", p_struct->bankName);


  /* member "accountNumber" */
  GWEN_XMLNode_SetCharValue(p_db, "accountNumber", p_struct->accountNumber);


  /* member "subAccountId" */
  GWEN_XMLNode_SetCharValue(p_db, "subAccountId", p_struct->subAccountId);


  /* member "accountName" */
  GWEN_XMLNode_SetCharValue(p_db, "accountName", p_struct->accountName);


  /* member "iban" */
  GWEN_XMLNode_SetCharValue(p_db, "iban", p_struct->iban);


  /* member "bic" */
  GWEN_XMLNode_SetCharValue(p_db, "bic", p_struct->bic);


  /* member "owner" */
  GWEN_XMLNode_SetCharValue(p_db, "owner", p_struct->owner);


  /* member "currency" */
  GWEN_XMLNode_SetCharValue(p_db, "currency", p_struct->currency);


  /* member "description" */
  GWEN_XMLNode_SetCharValue(p_db, "description", p_struct->description);


  /* member "accountType" */
  GWEN_XMLNode_SetIntValue(p_db, "accountType", p_struct->accountType);


  /* member "accountId" */
  GWEN_XMLNode_SetIntValue(p_db, "accountId", p_struct->accountId);


  /* member "balanceList" */
  { if (p_struct->balanceList) { GWEN_XMLNODE *dbDest; AB_BALANCE *elem; dbDest=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "balanceList"); elem=AB_Balance_List_First(p_struct->balanceList); while(elem) { GWEN_XMLNODE *dbElem; dbElem=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "balance"); assert(dbElem); AB_Balance_toXml(elem, dbElem); GWEN_XMLNode_AddChild(dbDest, dbElem); elem=AB_Balance_List_Next(elem); } GWEN_XMLNode_AddChild(p_db, dbDest); } }


  /* member "transactionList" */
  { if (p_struct->transactionList) { GWEN_XMLNODE *dbDest; AB_TRANSACTION *elem; dbDest=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "transactionList"); elem=AB_Transaction_List_First(p_struct->transactionList); while(elem) { GWEN_XMLNODE *dbElem; dbElem=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "transaction"); assert(dbElem); AB_Transaction_toXml(elem, dbElem); GWEN_XMLNode_AddChild(dbDest, dbElem); elem=AB_Transaction_List_Next(elem); } GWEN_XMLNode_AddChild(p_db, dbDest); } }


  /* member "eStatementList" */
  { if (p_struct->eStatementList) { GWEN_XMLNODE *dbDest; AB_DOCUMENT *elem; dbDest=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "eStatementList"); elem=AB_Document_List_First(p_struct->eStatementList); while(elem) { GWEN_XMLNODE *dbElem; dbElem=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "eStatement"); assert(dbElem); AB_Document_toXml(elem, dbElem); GWEN_XMLNode_AddChild(dbDest, dbElem); elem=AB_Document_List_Next(elem); } GWEN_XMLNode_AddChild(p_db, dbDest); } }


}

void AB_ImExporterAccountInfo_toXml(const AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_XMLNODE *p_db) {
  AB_ImExporterAccountInfo_WriteXml(p_struct, p_db);
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_fromXml(GWEN_XMLNODE *p_db) {
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;
  p_struct=AB_ImExporterAccountInfo_new();
  AB_ImExporterAccountInfo_ReadXml(p_struct, p_db);
  return p_struct;
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_GetByIban(const AB_IMEXPORTER_ACCOUNTINFO_LIST *p_list,  const char *p_cmp){
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;

  assert(p_list);
  p_struct = AB_ImExporterAccountInfo_List_First(p_list);
  while(p_struct) {
    int p_rv;

    if (p_struct->iban && p_cmp) p_rv=strcasecmp(p_cmp, p_struct->iban); else if (p_cmp) p_rv=1; else if (p_struct->iban) p_rv=-1; else p_rv=0;
    if (p_rv == 0)
      return p_struct;
    p_struct = AB_ImExporterAccountInfo_List_Next(p_struct);
  }
  return NULL;
}

AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_GetByAccountId(const AB_IMEXPORTER_ACCOUNTINFO_LIST *p_list, uint32_t p_cmp){
  AB_IMEXPORTER_ACCOUNTINFO *p_struct;

  assert(p_list);
  p_struct = AB_ImExporterAccountInfo_List_First(p_list);
  while(p_struct) {
    int p_rv;

    if (p_struct->accountId==p_cmp) p_rv=0; else if (p_cmp<p_struct->accountId) p_rv=-1; else p_rv=1;
    if (p_rv == 0)
      return p_struct;
    p_struct = AB_ImExporterAccountInfo_List_Next(p_struct);
  }
  return NULL;
}

void AB_ImExporterAccountInfo_toHashString(const AB_IMEXPORTER_ACCOUNTINFO *p_struct, GWEN_BUFFER *p_buffer) {
  assert(p_struct);
  /* member "country"*/
  if (p_struct->country) GWEN_Buffer_AppendString(p_buffer, p_struct->country);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "bankCode"*/
  if (p_struct->bankCode) GWEN_Buffer_AppendString(p_buffer, p_struct->bankCode);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "bankName"*/
  if (p_struct->bankName) GWEN_Buffer_AppendString(p_buffer, p_struct->bankName);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "accountNumber"*/
  if (p_struct->accountNumber) GWEN_Buffer_AppendString(p_buffer, p_struct->accountNumber);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "subAccountId"*/
  if (p_struct->subAccountId) GWEN_Buffer_AppendString(p_buffer, p_struct->subAccountId);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "accountName"*/
  if (p_struct->accountName) GWEN_Buffer_AppendString(p_buffer, p_struct->accountName);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "iban"*/
  if (p_struct->iban) GWEN_Buffer_AppendString(p_buffer, p_struct->iban);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "bic"*/
  if (p_struct->bic) GWEN_Buffer_AppendString(p_buffer, p_struct->bic);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "owner"*/
  if (p_struct->owner) GWEN_Buffer_AppendString(p_buffer, p_struct->owner);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "currency"*/
  if (p_struct->currency) GWEN_Buffer_AppendString(p_buffer, p_struct->currency);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "description"*/
  if (p_struct->description) GWEN_Buffer_AppendString(p_buffer, p_struct->description);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "accountType"*/
  { char numbuf[32]; snprintf(numbuf, sizeof(numbuf)-1, "%d", p_struct->accountType); numbuf[sizeof(numbuf)-1]=0; GWEN_Buffer_AppendString(p_buffer, numbuf); }
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "accountId"*/
  { char numbuf[32]; snprintf(numbuf, sizeof(numbuf)-1, "%d", p_struct->accountId); numbuf[sizeof(numbuf)-1]=0; GWEN_Buffer_AppendString(p_buffer, numbuf); }
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "balanceList" doesn't have with_hash flag, ignoring */
  /* member "transactionList" doesn't have with_hash flag, ignoring */
  /* member "eStatementList" doesn't have with_hash flag, ignoring */
}

static AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List2__freeAll_cb(AB_IMEXPORTER_ACCOUNTINFO *t, void *user_data) { AB_ImExporterAccountInfo_free(t); return NULL; } int AB_ImExporterAccountInfo_List2_freeAll(AB_IMEXPORTER_ACCOUNTINFO_LIST2 *tl) { if (tl) { AB_ImExporterAccountInfo_List2_ForEach(tl, AB_ImExporterAccountInfo_List2__freeAll_cb, NULL); AB_ImExporterAccountInfo_List2_free(tl); } else { DBG_ERROR(AQBANKING_LOGDOMAIN, "List missing"); return GWEN_ERROR_INVALID; } return 0; }
AB_TRANSACTION *AB_ImExporterAccountInfo_GetFirstTransaction(const AB_IMEXPORTER_ACCOUNTINFO *st, int ty, int cmd) { assert(st); if (st->transactionList) return AB_Transaction_List_FindFirstByType(st->transactionList, ty, cmd); return NULL; }
void AB_ImExporterAccountInfo_AddTransaction(AB_IMEXPORTER_ACCOUNTINFO *st, AB_TRANSACTION *t) { assert(st); if (NULL==st->transactionList) st->transactionList=AB_Transaction_List_new(); AB_Transaction_List_Add(t, st->transactionList); }
int AB_ImExporterAccountInfo_GetTransactionCount(const AB_IMEXPORTER_ACCOUNTINFO *st, int ty, int cmd) { assert(st); if (st->transactionList) return AB_Transaction_List_CountByType(st->transactionList, ty, cmd); return 0; }
AB_BALANCE *AB_ImExporterAccountInfo_GetFirstBalance(const AB_IMEXPORTER_ACCOUNTINFO *st) { assert(st); if (st->balanceList) return AB_Balance_List_First(st->balanceList); return NULL; }
void AB_ImExporterAccountInfo_AddBalance(AB_IMEXPORTER_ACCOUNTINFO *st, AB_BALANCE *bal) { assert(bal); if (NULL==st->balanceList) st->balanceList=AB_Balance_List_new(); AB_Balance_List_Add(bal, st->balanceList); }
AB_DOCUMENT *AB_ImExporterAccountInfo_GetFirstEStatement(const AB_IMEXPORTER_ACCOUNTINFO *st) { assert(st); if (st->eStatementList) return AB_Document_List_First(st->eStatementList); return NULL; }
void AB_ImExporterAccountInfo_AddEStatement(AB_IMEXPORTER_ACCOUNTINFO *st, AB_DOCUMENT *d) { assert(d); if (NULL==st->eStatementList) st->eStatementList=AB_Document_List_new(); AB_Document_List_Add(d, st->eStatementList); }
void AB_ImExporterAccountInfo_Clear(AB_IMEXPORTER_ACCOUNTINFO *st) { assert(st); if (st->transactionList) AB_Transaction_List_Clear(st->transactionList); if (st->balanceList) AB_Balance_List_Clear(st->balanceList); if (st->eStatementList) AB_Document_List_Clear(st->eStatementList); }
void AB_ImExporterAccountInfo_FillFromTransaction(AB_IMEXPORTER_ACCOUNTINFO *st, const AB_TRANSACTION *t) { const char *s; assert(st); assert(t); s=AB_Transaction_GetLocalBankCode(t); AB_ImExporterAccountInfo_SetBankCode(st, s); s=AB_Transaction_GetLocalAccountNumber(t); AB_ImExporterAccountInfo_SetAccountNumber(st, s); s=AB_Transaction_GetLocalSuffix(t); AB_ImExporterAccountInfo_SetSubAccountId(st, s); s=AB_Transaction_GetLocalIban(t); AB_ImExporterAccountInfo_SetIban(st, s); s=AB_Transaction_GetLocalBic(t); AB_ImExporterAccountInfo_SetBic(st, s); s=AB_Transaction_GetLocalName(t); AB_ImExporterAccountInfo_SetOwner(st, s); }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_GetByBankCodeAndAccountNumber(AB_IMEXPORTER_ACCOUNTINFO_LIST *l, const char *bankCode, const char *accountNumber, int accountType) { AB_IMEXPORTER_ACCOUNTINFO *iea; assert(l); if (!bankCode) bankCode=""; if (!accountNumber) accountNumber=""; iea=AB_ImExporterAccountInfo_List_First(l); while(iea) { const char *sBankCode; const char *sAccountNumber; sBankCode=AB_ImExporterAccountInfo_GetBankCode(iea); if (sBankCode==NULL) sBankCode=""; sAccountNumber=AB_ImExporterAccountInfo_GetAccountNumber(iea); if (sAccountNumber==NULL) sAccountNumber=""; if ((strcasecmp(sBankCode, bankCode)==0) && (strcasecmp(sAccountNumber, accountNumber)==0) && ((accountType<=AB_AccountType_Unknown) || (accountType==AB_ImExporterAccountInfo_GetAccountType(iea))) ) return iea; iea=AB_ImExporterAccountInfo_List_Next(iea); } return NULL; }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_Find(AB_IMEXPORTER_ACCOUNTINFO_LIST *l, uint32_t uniqueId, const char *iban, const char *bankCode, const char *accountNumber, int accountType) { AB_IMEXPORTER_ACCOUNTINFO *iea=NULL; assert(l); if (uniqueId) iea=AB_ImExporterAccountInfo_List_GetByAccountId(l, uniqueId); if (iea==NULL && iban && *iban) AB_ImExporterAccountInfo_List_GetByIban(l, iban); if (iea==NULL) iea=AB_ImExporterAccountInfo_List_GetByBankCodeAndAccountNumber(l, bankCode, accountNumber, accountType); return iea; }
int AB_ImExporterAccountInfo_Matches(const AB_IMEXPORTER_ACCOUNTINFO *a, uint32_t uniqueId, const char *country, const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty) { const char *lcountry; const char *lbankId; const char *laccountNumber; const char *lsubAccountId; const char *liban; const char *lcurrency; int lty; if (!country) country="*"; if (!bankId) bankId="*"; if (!accountNumber) accountNumber="*"; if (!subAccountId) subAccountId="*"; if (!iban) iban="*"; if (!currency) currency="*"; if (ty>=AB_AccountType_Last) ty=AB_AccountType_Unknown; lcountry=AB_ImExporterAccountInfo_GetCountry(a); lbankId=AB_ImExporterAccountInfo_GetBankCode(a); laccountNumber=AB_ImExporterAccountInfo_GetAccountNumber(a); lsubAccountId=AB_ImExporterAccountInfo_GetSubAccountId(a); liban=AB_ImExporterAccountInfo_GetIban(a); lcurrency=AB_ImExporterAccountInfo_GetCurrency(a); lty=AB_ImExporterAccountInfo_GetAccountType(a); if (!lcountry) lcountry=""; if (!lbankId) lbankId=""; if (!laccountNumber) laccountNumber=""; if (!lsubAccountId) lsubAccountId=""; if (!liban) liban=""; if (!lcurrency) lcurrency=""; if (lty>=AB_AccountType_Last || lty <=AB_AccountType_Unknown) lty=AB_AccountType_Unknown; if (((uniqueId==0 || uniqueId==AB_ImExporterAccountInfo_GetAccountId(a))) && (-1!=GWEN_Text_ComparePattern(lcountry, country, 0)) && (-1!=GWEN_Text_ComparePattern(lbankId, bankId, 0)) && (-1!=GWEN_Text_ComparePattern(laccountNumber, accountNumber, 0)) && (-1!=GWEN_Text_ComparePattern(lsubAccountId, subAccountId, 0)) && (-1!=GWEN_Text_ComparePattern(liban, iban, 0)) && (-1!=GWEN_Text_ComparePattern(lcurrency, currency, 0)) && ((ty==AB_AccountType_Unknown) || (ty==lty))) return 1; return 0; }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List__FindInternal(AB_IMEXPORTER_ACCOUNTINFO *a, uint32_t uniqueId, const char *country, const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty) { if (!country) country="*"; if (!bankId) bankId="*"; if (!accountNumber) accountNumber="*"; if (!subAccountId) subAccountId="*"; if (!iban) iban="*"; if (!currency) currency="*"; if (ty>=AB_AccountType_Last) ty=AB_AccountType_Unknown; while(a) { int rv; rv=AB_ImExporterAccountInfo_Matches(a, uniqueId, country, bankId, accountNumber, subAccountId, iban, currency, ty); if (rv==1) break; a=AB_ImExporterAccountInfo_List_Next(a); } /* while */ return a; }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_FindFirst(AB_IMEXPORTER_ACCOUNTINFO_LIST *al, uint32_t uniqueId, const char *country, const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty) { AB_IMEXPORTER_ACCOUNTINFO *a; if (AB_ImExporterAccountInfo_List_GetCount(al)==0) { DBG_INFO(AQBANKING_LOGDOMAIN, "No accounts"); return NULL; } a=AB_ImExporterAccountInfo_List_First(al); assert(a); return AB_ImExporterAccountInfo_List__FindInternal(a, uniqueId, country, bankId, accountNumber, subAccountId, iban, currency, ty); }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_FindNext(AB_IMEXPORTER_ACCOUNTINFO *a, uint32_t uniqueId, const char *country, const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty) { assert(a); a=AB_ImExporterAccountInfo_List_Next(a); if (a==NULL) { DBG_INFO(AQBANKING_LOGDOMAIN, "No more account specs"); return NULL; } return AB_ImExporterAccountInfo_List__FindInternal(a, uniqueId, country, bankId, accountNumber, subAccountId, iban, currency, ty); }
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterAccountInfo_List_GetOrAdd(AB_IMEXPORTER_ACCOUNTINFO_LIST *l, uint32_t uniqueId, const char *iban, const char *bankCode, const char *accountNumber, int accountType) { AB_IMEXPORTER_ACCOUNTINFO *iea=NULL; assert(l); iea=AB_ImExporterAccountInfo_List_Find(l, uniqueId, iban, bankCode, accountNumber, accountType); if (iea==NULL) { iea=AB_ImExporterAccountInfo_new(); AB_ImExporterAccountInfo_SetAccountId(iea, uniqueId); AB_ImExporterAccountInfo_SetIban(iea, iban); AB_ImExporterAccountInfo_SetBankCode(iea, bankCode); AB_ImExporterAccountInfo_SetAccountNumber(iea, accountNumber); AB_ImExporterAccountInfo_SetAccountType(iea, accountType); AB_ImExporterAccountInfo_List_Add(iea, l); } return iea; }

/* code headers */

