Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HBCI::Date Class Reference

Represents a date in Openhbci. More...

#include <date.h>

List of all members.

Public Methods

 Date (int day, int month, int year)
 Date ()
 Date (const string &str, int yearsize=4)
 Date (const struct tm *tm)
bool isValid () const
string toString () const
int day () const
int month () const
int year () const
tm to_tm () const
time_t to_time_t () const
int compare (const Date &d) const
int compareTime (const Time &t1, const Date &d2, const Time &t2) const


Detailed Description

Represents a date in Openhbci.

Represents a date in Openhbci.

Author:
fabian kaiser


Constructor & Destructor Documentation

HBCI::Date::Date int    day,
int    month,
int    year
 

Create a Data.

Parameters:
day  Day of the month, in the range 1 to 31.
month  Month of the year, in the range of 1 (January) to 12 (December).
year  Absolute year, i.e. the number of years since year zero.

HBCI::Date::Date  
 

Creates a blank date; day, month, and year are set to zero.

HBCI::Date::Date const string &    str,
int    yearsize = 4
 

creates a date from a string containing a HBCI conform date

Author:
Martin Preuss<openhbci@aquamaniac.de>
Parameters:
str  The string containing the HBCI conform date (YYYYMMDD or YYMMDD or MMDD, depending on the argument yearsize). Note: The format with two-digit year is obviously broken, but SWIFT MT940 still has it, so we need to support it. Note further that Swift MT940-Specs DO NOT contain information on how those two digits are to be interpreted, which is a bad idea and will screw up this spec at the next turn of a century. In the meantime, we arbitrarily decided to interpret a two-digit year YY as number of years from year 2000 if YY <= 80, and as number of years from year 1900 if YY > 80.
yearsize  The size of the year in the string (if zero then the year will not be read instead it will be set from the current date); default is 4

HBCI::Date::Date const struct tm *    tm
 

Create a Date when given a struct tm (see ctime(3)).


Member Function Documentation

int HBCI::Date::compare const Date &    d const
 

Compares the date of this object with the one given as argument.

(This method is used by the operators.)

Returns :
0 if both dates are equal; -1 if this object's date occurs before the argument's date; 1 if this object's date occurs after the argument's date.
Author:
Martin Preuss<openhbci@aquamaniac.de>

int HBCI::Date::compareTime const Time   t1,
const Date &    d2,
const Time   t2
const
 

Compares Date and Time with another given Date and Time.

Argument t1 and this object are the one point in time, and arguments Date d2 and Time t2 are the other point in time.

Returns :
0 if both points in time are equal; -1 if this object's date and Time t1 occurs before the other point in time; 1 if this object's date and Time t1 occurs after the Date d2 and Time t2.
Author:
Christian Stimming <stimming@tuhh.de>

int HBCI::Date::day   const [inline]
 

Returns the stored day of the month, in the range 1 to 31.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
day (1-31);

bool HBCI::Date::isValid   const
 

Checks the date, and tells whether the date is valid.

Please note: At some places in HBCI, even the Feb 31 is valid. That represents the date of actions that occur "on the last day of each month". Therefore those dates are seen as valid in this method.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
true if the date is valid

int HBCI::Date::month   const [inline]
 

Returns the stored month of the year, in the range of 1 (January) to 12 (December).

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
month (1-12);

time_t HBCI::Date::to_time_t   const
 

Returns this date as a time_t value (see time(2)), but only the fields tm_mday, tm_mon, and tm_year are used.

struct tm HBCI::Date::to_tm   const
 

Returns this date as a struct tm (see ctime(3)), but only the fields tm_mday, tm_mon, and tm_year are used. All other fields are still zero.

string HBCI::Date::toString   const
 

Returns a hbci-conform string representation of given date (YYYYMMDD)

int HBCI::Date::year   const [inline]
 

Returns the stored year, which is the absolute number of years from year zero.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
The absolute year in the range of 0-2100.


The documentation for this class was generated from the following file:
Generated on Mon Jun 23 13:41:09 2003 for openhbci by doxygen1.2.17