Talos-0.3/Date.hxx
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef TALOS_FILE_DATE_HXX
00022
00023
00024
namespace Talos
00025 {
00026
00028 class Date
00029 {
00030
private:
00032
int year_;
00034
int month_;
00036
int day_;
00038
int hour_;
00040
int minutes_;
00042
int seconds_;
00044 vector<int> month_lengths_;
00045
00046
void LeapYearAdjust();
00047
void Adjust();
00048
00049
public:
00050
Date();
00051
Date(
int yyyymmdd);
00052
Date(
int yyyy,
int mm,
int dd = 1,
00053
int hh = 0,
int mn = 0,
int sc = 0);
00054
00055
void SetDate(
int yyyymmdd);
00056
void SetDate(
int yyyy,
int mm,
int dd = 1,
00057
int hh = 0,
int mn = 0,
int sc = 0);
00058
00059
bool LeapYear(
int year)
const;
00060
bool LeapYear()
const;
00061
00062
int GetDate()
const;
00063
00064 string
GetDate(
const string& format)
const;
00065
template <
class T>
00066
void GetDate(
const string& format, T& date)
const;
00067
00068
int GetYear()
const;
00069
int GetMonth()
const;
00070
int GetDay()
const;
00071
int GetHour()
const;
00072
int GetMinutes()
const;
00073
int GetSeconds()
const;
00074
00075
void AddYears(
int nb_yy);
00076
void AddMonths(
int nb_mm);
00077
void AddDays(
int nb_dd);
00078
void AddHours(
int nb_hh);
00079
void AddMinutes(
int nb_mn);
00080
void AddSeconds(
int nb_sc);
00081
00082
void SetYear(
int yyyy);
00083
void SetMonth(
int mm);
00084
void SetDay(
int dd);
00085
void SetHour(
int hh);
00086
void SetMinutes(
int mn);
00087
void SetSeconds(
int sc);
00088
00089
int GetDayNumber()
const;
00090
int GetNumberOfDays()
const;
00091
int GetDaysFrom(
Date date)
const;
00092
00093
int GetNumberOfHours()
const;
00094
int GetNumberOfMinutes()
const;
00095
int GetNumberOfSeconds()
const;
00096
00097
int GetWeekDay()
const;
00098 };
00099
00100 }
00101
00102
00103
#define TALOS_FILE_DATE_HXX
00104
#endif
Generated on Sun Oct 3 19:22:03 2004 for Talos by
1.3.8