ktoblzcheck
1.52.0
|
Checking of International Bank Account Numbers (IBAN) More...
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <ctype.h>
Go to the source code of this file.
Classes | |
class | Iban |
Stores one IBAN (International Bank Account Number) More... | |
class | IbanCheck |
IBAN bank information database and IBAN verification. More... | |
Typedefs | |
typedef IbanCheck::Result | IbanCheck_Result |
Functions | |
IbanCheck methods | |
IbanCheck * | IbanCheck_new (const char *filename) |
void | IbanCheck_free (IbanCheck *p) |
IbanCheck_Result | IbanCheck_check_str (const IbanCheck *p, const char *iban, const char *country) |
IbanCheck_Result | IbanCheck_check_iban (const IbanCheck *p, const Iban *iban, const char *country) |
IbanCheck_Result | IbanCheck_bic_position (const IbanCheck *p, const char *iban, int *start, int *end) |
const char * | IbanCheck_resultText (IbanCheck_Result res) |
int | IbanCheck_error (const IbanCheck *p) |
int | IbanCheck_selftest (IbanCheck *p) |
Iban methods | |
Iban * | Iban_new (const char *iban, int normalize) |
void | Iban_free (Iban *p) |
const char * | Iban_transmissionForm (const Iban *iban) |
const char * | Iban_printableForm (Iban *iban) |
Checking of International Bank Account Numbers (IBAN)
cvs : $Id$ begin : Tue Apr 19 2005 copyright : (C) 2005 by Andreas Degert (some parts Gerhard Gappmeier) email : ad@pa pyru s-gmb h.de
based on the older version from Gerhard Gappmeier (gerha) rd.g appme ier@ ascol ab.c om
*
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. *
typedef IbanCheck::Result IbanCheck_Result |
void Iban_free | ( | Iban * | p | ) |
Default destructor.
Iban* Iban_new | ( | const char * | iban, |
int | normalize | ||
) |
Constructor from a string
const char* Iban_printableForm | ( | Iban * | iban | ) |
Returns the printable format for the IBAN
const char* Iban_transmissionForm | ( | const Iban * | iban | ) |
Returns the transmission format for the IBAN
IbanCheck_Result IbanCheck_bic_position | ( | const IbanCheck * | p, |
const char * | iban, | ||
int * | start, | ||
int * | end | ||
) |
Returns the position of the BIC inside the IBAN. The iban should be formally correct, if not an error Result might be returned.
p | IbanCheck object |
iban | [in] IBAN in transmission format |
start | [out] start of BIC (0-based index) |
end | [out] first position after BIC (0-based index) |
IbanCheck_Result IbanCheck_check_iban | ( | const IbanCheck * | p, |
const Iban * | iban, | ||
const char * | country | ||
) |
Check the formal correctness of a given iban. This function checks if the prefix is known, if the length is correct for the prefix, if the checksum is ok and if the prefix is valid for a given country (if set).
IbanCheck_Result IbanCheck_check_str | ( | const IbanCheck * | p, |
const char * | iban, | ||
const char * | country | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
p | IbanCheck object |
iban | IBAN in transmission format |
country | 2-character country code (ISO 3166) |
int IbanCheck_error | ( | const IbanCheck * | p | ) |
void IbanCheck_free | ( | IbanCheck * | p | ) |
Default destructor
IbanCheck* IbanCheck_new | ( | const char * | filename | ) |
Constructor that initalizes the mappings from a data file at filename.
If the file name argument is empty, then the compile-time datafile will be used. On Windows, the location of the datafile will be looked up in the registry.
If the file could not be found or is not successfully read, the mappings will be empty. Use error() to check for such an error condition.
filename | If empty, then the compile-time file name will be used. Otherwise the relative or absolute full filename of the data file |
const char* IbanCheck_resultText | ( | IbanCheck_Result | res | ) |
Convert Result code into an english message string.
res | Result code from check() or bic_position() |
int IbanCheck_selftest | ( | IbanCheck * | p | ) |
uses the example data to test the check routines.