ktoblzcheck  1.52.0
Classes | Typedefs
iban.h File Reference

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
IbanCheckIbanCheck_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
IbanIban_new (const char *iban, int normalize)
 
void Iban_free (Iban *p)
 
const char * Iban_transmissionForm (const Iban *iban)
 
const char * Iban_printableForm (Iban *iban)
 

Detailed Description

Checking of International Bank Account Numbers (IBAN)

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

cvs : $Id$ begin : Tue Apr 19 2005 copyright : (C) 2005 by Andreas Degert (some parts Gerhard Gappmeier) email : ad@pa.nosp@m.pyru.nosp@m.s-gmb.nosp@m.h.de

based on the older version from Gerhard Gappmeier (gerha.nosp@m.rd.g.nosp@m.appme.nosp@m.ier@.nosp@m.ascol.nosp@m.ab.c.nosp@m.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 Documentation

◆ IbanCheck_Result

Function Documentation

◆ Iban_free()

void Iban_free ( Iban p)

Default destructor.

◆ Iban_new()

Iban* Iban_new ( const char *  iban,
int  normalize 
)

Constructor from a string

◆ Iban_printableForm()

const char* Iban_printableForm ( Iban iban)

Returns the printable format for the IBAN

◆ Iban_transmissionForm()

const char* Iban_transmissionForm ( const Iban iban)

Returns the transmission format for the IBAN

◆ IbanCheck_bic_position()

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.

Parameters
pIbanCheck 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_check_iban()

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).

Parameters
pIbanCheck object
ibanIban instance
country2-character country code (ISO 3166)

◆ IbanCheck_check_str()

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.

Parameters
pIbanCheck object
ibanIBAN in transmission format
country2-character country code (ISO 3166)

◆ IbanCheck_error()

int IbanCheck_error ( const IbanCheck p)
Returns
false if the data file could not be opened and successfully read.

◆ IbanCheck_free()

void IbanCheck_free ( IbanCheck p)

Default destructor

◆ IbanCheck_new()

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.

Parameters
filenameIf empty, then the compile-time file name will be used. Otherwise the relative or absolute full filename of the data file

◆ IbanCheck_resultText()

const char* IbanCheck_resultText ( IbanCheck_Result  res)

Convert Result code into an english message string.

Note
if the value of res is an integer not inside the enum range, a special message will be returned.
Parameters
resResult code from check() or bic_position()

◆ IbanCheck_selftest()

int IbanCheck_selftest ( IbanCheck p)

uses the example data to test the check routines.

Returns
false if not successful