OpendTect
6.6
|
A date info class. More...
Public Types | |
enum | DayOfWeek { Su =0 , Mo , Tu , We , Th , Fr , Sa } |
enum | Month { Jan =0 , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec } |
Public Member Functions | |
DateInfo () | |
Today. More... | |
DateInfo (const char *) | |
DateInfo (int the_key) | |
DateInfo (int usryr, const char *mnth, int usrdy) | |
DateInfo (int usryr, int usrmnth, int usrdy) | |
DateInfo (int usryr, Month, int usrdy) | |
void | addMonths (int) |
int | day () const |
bool | fromNumString (const char *, bool yearfirst) |
bool | fromStdDateString (const char *) |
bool | fromString (const char *) |
const char * | fullMonthName () const |
void | getUsrDisp (BufferString &, bool withcurtime) const |
bool | isUdf () const |
int | key () const |
Month | month () const |
const char * | monthName () const |
bool | operator!= (const DateInfo &) const |
DateInfo & | operator+= (int) |
DateInfo & | operator-= (int dys) |
bool | operator< (const DateInfo &) const |
bool | operator<= (const DateInfo &) const |
bool | operator== (const DateInfo &) const |
bool | operator> (const DateInfo &) const |
bool | operator>= (const DateInfo &) const |
void | setDay (int) |
void | setMonth (int) |
void | setMonth (Month) |
void | setUdf (bool yn=true) |
void | setYear (int) |
void | toString (BufferString &) const |
int | usrMonth () const |
int | weekDay () const |
Sunday => 1. More... | |
const char * | weekDayName () const |
const char * | whenRelative (const DateInfo *di=0) const |
int | year () const |
Static Public Member Functions | |
static int | daysInMonth (int yr, Month) |
static int | daysInYear (int yr) |
static const char * | fullMonthName (int) |
static const char * | fullMonthName (Month) |
static const char ** | sAllDaysInMonth () |
0 to 31 More... | |
static const char ** | sFullMonths () |
str = sFullMonths()[Month] More... | |
static Month | usrMonth2Month (int) |
Private Member Functions | |
void | addDay (BufferString &) const |
void | calcDays1900 () |
void | calcDMY () |
void | getDaysMonths (int, int, int &, int &) |
void | getRel (const DateInfo &, BufferString &) const |
void | getRelToday (BufferString &) const |
Private Attributes | |
int | days1900_ |
int | days_ |
int | months_ |
int | years_ |
Friends | |
int | operator- (const DateInfo &, const DateInfo &) |
A date info class.
Class does not work before 1900. Non-default constructors are for dates other than today. Constructors accept numbers as in normal usage.
Parsing: toString/fromString format is [n]n-xxx-nnnn, like 14-nov-2008. fromStdDateString() reads the 'file' standard,like 'Wed Nov 14 12:50:15 2008'. fromNumString() reads '2008-11-14' or '14-11-2008' or the same with slashes, dots or colons.
The class has some kewl 'relative' printouts.
<>
enum DateInfo::DayOfWeek |
enum DateInfo::Month |
DateInfo::DateInfo | ( | ) |
Today.
DateInfo::DateInfo | ( | int | usryr, |
int | usrmnth, | ||
int | usrdy | ||
) |
DateInfo::DateInfo | ( | int | usryr, |
Month | , | ||
int | usrdy | ||
) |
DateInfo::DateInfo | ( | int | usryr, |
const char * | mnth, | ||
int | usrdy | ||
) |
DateInfo::DateInfo | ( | const char * | ) |
DateInfo::DateInfo | ( | int | the_key | ) |
|
private |
void DateInfo::addMonths | ( | int | ) |
|
private |
|
private |
|
inline |
|
static |
|
inlinestatic |
bool DateInfo::fromNumString | ( | const char * | , |
bool | yearfirst | ||
) |
bool DateInfo::fromStdDateString | ( | const char * | ) |
bool DateInfo::fromString | ( | const char * | ) |
|
inline |
|
static |
|
static |
|
private |
|
private |
|
private |
void DateInfo::getUsrDisp | ( | BufferString & | , |
bool | withcurtime | ||
) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
DateInfo& DateInfo::operator+= | ( | int | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
0 to 31
void DateInfo::setDay | ( | int | ) |
void DateInfo::setMonth | ( | int | ) |
void DateInfo::setMonth | ( | Month | ) |
void DateInfo::setUdf | ( | bool | yn = true | ) |
void DateInfo::setYear | ( | int | ) |
|
static |
str = sFullMonths()[Month]
void DateInfo::toString | ( | BufferString & | ) | const |
|
inline |
|
static |
int DateInfo::weekDay | ( | ) | const |
Sunday => 1.
const char* DateInfo::weekDayName | ( | ) | const |
const char* DateInfo::whenRelative | ( | const DateInfo * | di = 0 | ) | const |
|
inline |
|
private |
|
private |
|
private |
|
private |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022