MySQLaux 0.6 is free software from Langensoft written by Thomas Langen.

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

MySQLaux::Date Class Reference

Representation for the MySQLaux DATE type. More...

#include <Date.h>

List of all members.

Public Methods

 Date (const char *s) throw (InvalidDate)
 Constructor from character string. More...

 Date () throw ()
 Constructor for invalid date. More...

unsigned day () const throw (InvalidDate)
 Numerical day in month. More...

unsigned month () const throw (InvalidDate)
 Numerical month in year. More...

unsigned year () const throw (InvalidDate)
 Numerical year. More...

string asString (unsigned format) const throw (InvalidDate)
 Get date as string. More...

unsigned long asBCD () const throw (InvalidDate)
 Get date as binary-coded decimal. More...


Detailed Description

Representation for the MySQLaux DATE type.

Definition at line 49 of file Date.h.


Constructor & Destructor Documentation

MySQLaux::Date::Date ( const char * s ) throw (InvalidDate)
 

Constructor from character string.

MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.

Exceptions:
InvalidDate   the input does not fit totally to the required format

MySQLaux::Date::Date ( ) throw () [inline]
 

Constructor for invalid date.

Definition at line 67 of file Date.h.

00067                            { _year = _month = _day = 0; }
00068 


Member Function Documentation

unsigned long MySQLaux::Date::asBCD ( ) const throw (InvalidDate)
 

Get date as binary-coded decimal.

Format such as: 19640411

string MySQLaux::Date::asString ( unsigned format ) const throw (InvalidDate)
 

Get date as string.

The format depends on the flag, as shown:
flagformat
111 April 1964
5 (or any other)1964-4-11

unsigned MySQLaux::Date::day ( ) const throw (InvalidDate) [inline]
 

Numerical day in month.

Definition at line 72 of file Date.h.

00073     {
00074       if (_day == 0 || _day > 31)
00075         throw InvalidDate();
00076       return _day;
00077 

unsigned MySQLaux::Date::month ( ) const throw (InvalidDate) [inline]
 

Numerical month in year.

Definition at line 82 of file Date.h.

00083     {
00084       if (_month == 0 || _month > 12)
00085         throw InvalidDate();
00086       return _month;
00087 

unsigned MySQLaux::Date::year ( ) const throw (InvalidDate) [inline]
 

Numerical year.

Definition at line 92 of file Date.h.

00093     {
00094       if (_year < 1000 | _year > 9999)
00095         throw InvalidDate();
00096       return _year;
00097 


The documentation for this class was generated from the following file:
Generated at Fri Apr 6 11:20:13 2001 for MySQLaux by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001