ktoblzcheck  1.52.0
Classes | Macros | Typedefs
ktoblzcheck.h File Reference

Checking of German BLZ and account numbers. More...

#include <string>
#include <map>
#include <vector>
#include <ctime>

Go to the source code of this file.

Classes

class  AccountNumberCheck
 German bank information database and account code verification. More...
 
class  AccountNumberCheck::Record
 Available information about one bank. More...
 

Macros

#define KTOBLZCHECK_VERSION_MAJOR   1
 
#define KTOBLZCHECK_VERSION_MINOR   52
 

Typedefs

typedef AccountNumberCheck::Result AccountNumberCheck_Result
 
typedef AccountNumberCheck::Record AccountNumberCheck_Record
 

Functions

AccountNumberCheck methods
AccountNumberCheckAccountNumberCheck_new ()
 
AccountNumberCheckAccountNumberCheck_new_file (const char *filename)
 
void AccountNumberCheck_delete (AccountNumberCheck *a)
 
AccountNumberCheck_Result AccountNumberCheck_check (const AccountNumberCheck *a, const char *bankId, const char *accountId)
 
const AccountNumberCheck_RecordAccountNumberCheck_findBank (const AccountNumberCheck *a, const char *bankId)
 
unsigned int AccountNumberCheck_bankCount (const AccountNumberCheck *a)
 
void AccountNumberCheck_createIndex (AccountNumberCheck *a)
 
Ktoblzcheck library information
const char * AccountNumberCheck_stringEncoding ()
 
const char * AccountNumberCheck_libraryVersion ()
 
char * AccountNumberCheck_bankdata_dir ()
 
AccountNumberCheck_Record methods
void AccountNumberCheck_Record_delete (AccountNumberCheck_Record *a)
 
AccountNumberCheck_RecordAccountNumberCheck_Record_copy (const AccountNumberCheck_Record *a)
 
unsigned long AccountNumberCheck_Record_bankId (const AccountNumberCheck_Record *a)
 
const char * AccountNumberCheck_Record_bankName (const AccountNumberCheck_Record *a)
 
const char * AccountNumberCheck_Record_location (const AccountNumberCheck_Record *a)
 

Detailed Description

Checking of German BLZ and account numbers.

This file contains the classes and C wrappers for checking German BLZ (bank codes) and account numbers.

Macro Definition Documentation

◆ KTOBLZCHECK_VERSION_MAJOR

#define KTOBLZCHECK_VERSION_MAJOR   1

-*-c++-*-****************************************************************

This file is AUTO-GENERATED from ktoblzcheck.h.in! All changes here will be lost!


cvs : $Id$ begin : Sat Aug 10 2002 copyright : (C) 2002, 2003 by Fabian Kaiser and Christian Stimming email : fabia.nosp@m.n@op.nosp@m.enhbc.nosp@m.i.de

                                                                    *

This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *

  • This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. *
  • You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA *
  • The major version number of this library.

Introduced in ktoblzcheck-1.10.

◆ KTOBLZCHECK_VERSION_MINOR

#define KTOBLZCHECK_VERSION_MINOR   52

The minor version number of this library.

Introduced in ktoblzcheck-1.10.

Typedef Documentation

◆ AccountNumberCheck_Record

◆ AccountNumberCheck_Result

Function Documentation

◆ AccountNumberCheck_bankCount()

unsigned int AccountNumberCheck_bankCount ( const AccountNumberCheck a)

Returns the number of bank-records currently loaded.

◆ AccountNumberCheck_bankdata_dir()

char* AccountNumberCheck_bankdata_dir ( )

Returns the directory where the bankdata file is stored. The returned value is owned by the caller and must be free'd when no longer being used.

This function was introduced in ktoblzcheck-1.13.

◆ AccountNumberCheck_check()

AccountNumberCheck_Result AccountNumberCheck_check ( const AccountNumberCheck a,
const char *  bankId,
const char *  accountId 
)

Check if bankId and accountId form a valid combination.

The returned value is simply an integer. The meanings of each integer values are defined in the AccountNumberCheck::Result enum, which is the following:

  • 0 everything is ok, account and bank match
  • 1 Could not be validated because the validation algorithm is unknown/unimplemented in ktoblzcheck
  • 2 account and bank probably do not match
  • 3 No bank with the specified bankid could be found
Parameters
aThe AccountNumberCheck object
bankIdThe bank code (BLZ) of the bank to test
accountIdThe account id to check

◆ AccountNumberCheck_createIndex()

void AccountNumberCheck_createIndex ( AccountNumberCheck a)

Generates an index over the bankIds.
Currently not implemented.

◆ AccountNumberCheck_delete()

void AccountNumberCheck_delete ( AccountNumberCheck a)

Destructor. All entries of the bank database are deleted as well.

Note
This destructor also destroys any references that have been returned by AccountNumberCheck_findBank()! You have to make sure not to use these references any longer after this destructor has been called.

◆ AccountNumberCheck_findBank()

const AccountNumberCheck_Record* AccountNumberCheck_findBank ( const AccountNumberCheck a,
const char *  bankId 
)

Find the info-record for a bank specified by bankId or otherwise return NULL.

Note
The returned objects are still owned by this object! You have to make sure not to use the returned references after the destructor AccountNumberCheck_delete() has been called.
Returns
A pointer to the resulting bank object, or NULL if no matching bank could be found. The returned object is still owned by this AccountNumberObject and it becomes invalid if the AcccountNumberObject is being deleted.

◆ AccountNumberCheck_libraryVersion()

const char* AccountNumberCheck_libraryVersion ( )

Returns the value of ktoblzcheck's configuration variable VERSION as a string, which can be "1.6" or something similar.

This function was introduced in ktoblzcheck-1.7.

◆ AccountNumberCheck_new()

AccountNumberCheck* AccountNumberCheck_new ( )

Default Constructor.

This constructor also initializes the bank-database. The bank data is obtained from several files which are located in a directory looked up at run-time (with a fallback check for a compile-time path). Default is $prefix/share/ktoblzcheck (set in configure.in) where default for $prefix is /usr/local.

Inside the data directory, all bankdata files with a date in the filename are processed, according to the three-month validity periods, because each bankdata file is valid for three months. See README for a more detailed explanation.

◆ AccountNumberCheck_new_file()

AccountNumberCheck* AccountNumberCheck_new_file ( const char *  filename)

Constructor that initialize the bank-database from a data file at filename.

If the file could not be found, then the resulting AccountNumberCheck object simply has an empty bank database and a message is printed to stderr.

Parameters
filenameThe absolute location of the KTOBLZCheck-database

◆ AccountNumberCheck_Record_bankId()

unsigned long AccountNumberCheck_Record_bankId ( const AccountNumberCheck_Record a)

Returns the id of the bank (german BLZ)

◆ AccountNumberCheck_Record_bankName()

const char* AccountNumberCheck_Record_bankName ( const AccountNumberCheck_Record a)

Returns the name of the bank as listed in the file of the Deutsche Bundesbank

◆ AccountNumberCheck_Record_copy()

AccountNumberCheck_Record* AccountNumberCheck_Record_copy ( const AccountNumberCheck_Record a)

Copy constructor. The returned object will be owned by the caller and has to be deleted by the caller when no longer used. FIXME: Needs to be tested whether it works correctly – internally it uses the automatically synthetized copy constructor of the C++ compiler.

◆ AccountNumberCheck_Record_delete()

void AccountNumberCheck_Record_delete ( AccountNumberCheck_Record a)

Destructor

◆ AccountNumberCheck_Record_location()

const char* AccountNumberCheck_Record_location ( const AccountNumberCheck_Record a)

Returns the city where the bank is located

◆ AccountNumberCheck_stringEncoding()

const char* AccountNumberCheck_stringEncoding ( )

Returns the character encoding that is used when strings are returned. So far this has been "ISO-8859-15" (up to and including version ktoblzcheck-1.15) but at some point in the future it might change into "UTF-8".

To obtain the encoding string in your application in a form that is backward-compatible to all ktoblzcheck-versions, do the following:

    const char *ktoblzcheck_encoding = 
#ifdef KTOBLZCHECK_VERSION_MAJOR
      AccountNumberCheck_stringEncoding()
#else
      "ISO-8859-15"
#endif
      ;
 This function was introduced in ktoblzcheck-1.7.