Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Static Public Member Functions

Date Class Reference
[Datastructures]

Date Class. More...

#include <OpenMS/DATASTRUCTURES/Date.h>

Inheritance diagram for Date:
QDate

List of all members.

Public Member Functions

 Date ()
 Default constructor.
 Date (const Date &date)
 Copy constructor.
 Date (const QDate &date)
 Copy constructor from Qt base class.
Dateoperator= (const Date &source)
 Assignment operator.
void set (const String &date)
 sets data from a string
void set (UInt month, UInt day, UInt year)
 sets data from three integers
String get () const
 Returns a string representation of the date.
void get (UInt &month, UInt &day, UInt &year) const
 Fills the arguments with the date.
void clear ()
 Sets the undefined date: 00/00/0000.

Static Public Member Functions

static Date today ()
 Returns the current date.

Detailed Description

Date Class.

This class implements date handling. Import and export to/from both string and integers is possible.


Constructor & Destructor Documentation

Date (  ) 

Default constructor.

Fills the object with an undefined date: 00/00/0000

Date ( const Date date  ) 

Copy constructor.

Date ( const QDate date  ) 

Copy constructor from Qt base class.


Member Function Documentation

void clear (  ) 

Sets the undefined date: 00/00/0000.

void get ( UInt month,
UInt day,
UInt year 
) const

Fills the arguments with the date.

Give the numbers in the following order: month, day and year.

String get (  )  const

Returns a string representation of the date.

Uses the iso/ansi date format: 'yyyy-mm-dd'

Date& operator= ( const Date source  ) 

Assignment operator.

void set ( const String date  ) 

sets data from a string

The following date formats are supoported:

  • mm/dd/yyyy
  • dd.mm.yyyy
  • yyyy-mm-dd
Exceptions:
Exception::ParseError is thrown if the date is given in the wrong format
void set ( UInt  month,
UInt  day,
UInt  year 
)

sets data from three integers

Exceptions:
Exception::ParseError is thrown if an invalid date is given
static Date today (  )  [static]

Returns the current date.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:51 using doxygen 1.7.1