GNU CommonC++
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ost::Date Class Reference

The Date class uses a julian date representation of the current year, month, and day. More...

#include <numbers.h>

Inheritance diagram for ost::Date:
ost::DateNumber ost::Datetime

Public Member Functions

 Date (time_t tm)
 
 Date (tm *dt)
 
 Date (char *str, size_t size=0)
 
 Date (int year, unsigned month, unsigned day)
 
 Date ()
 
virtual ~Date ()
 
int getYear (void) const
 
unsigned getMonth (void) const
 
unsigned getDay (void) const
 
unsigned getDayOfWeek (void) const
 
char * getDate (char *buffer) const
 
time_t getDate (void) const
 
time_t getDate (tm *buf) const
 
long getValue (void) const
 
void setDate (const char *str, size_t size=0)
 
bool isValid (void) const
 
 operator long () const
 
String operator() () const
 
Dateoperator++ ()
 
Dateoperator-- ()
 
Dateoperator+= (const long val)
 
Dateoperator-= (const long val)
 
int operator== (const Date &date)
 
int operator!= (const Date &date)
 
int operator< (const Date &date)
 
int operator<= (const Date &date)
 
int operator> (const Date &date)
 
int operator>= (const Date &date)
 
bool operator! () const
 

Protected Member Functions

void toJulian (long year, long month, long day)
 
void fromJulian (char *buf) const
 
virtual void update (void)
 A method to use to "post" any changed values when shadowing a mixed object class.
 

Protected Attributes

long julian
 

Friends

Date operator+ (const Date &date, const long val)
 
Date operator- (const Date &date, const long val)
 
Date operator+ (const long val, const Date &date)
 
Date operator- (const long val, const Date &date)
 

Detailed Description

The Date class uses a julian date representation of the current year, month, and day.

This is then manipulated in several forms and may be exported as needed.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m

julian number based date class.

Constructor & Destructor Documentation

◆ Date() [1/5]

ost::Date::Date ( time_t  tm)

◆ Date() [2/5]

ost::Date::Date ( tm *  dt)

◆ Date() [3/5]

ost::Date::Date ( char *  str,
size_t  size = 0 
)

◆ Date() [4/5]

ost::Date::Date ( int  year,
unsigned  month,
unsigned  day 
)

◆ Date() [5/5]

ost::Date::Date ( )

◆ ~Date()

virtual ost::Date::~Date ( )
virtual

Member Function Documentation

◆ fromJulian()

void ost::Date::fromJulian ( char *  buf) const
protected

◆ getDate() [1/3]

char * ost::Date::getDate ( char *  buffer) const

◆ getDate() [2/3]

time_t ost::Date::getDate ( tm *  buf) const

◆ getDate() [3/3]

time_t ost::Date::getDate ( void  ) const

◆ getDay()

unsigned ost::Date::getDay ( void  ) const

◆ getDayOfWeek()

unsigned ost::Date::getDayOfWeek ( void  ) const

◆ getMonth()

unsigned ost::Date::getMonth ( void  ) const

◆ getValue()

long ost::Date::getValue ( void  ) const

◆ getYear()

int ost::Date::getYear ( void  ) const

◆ isValid()

bool ost::Date::isValid ( void  ) const

◆ operator long()

ost::Date::operator long ( ) const
inline

◆ operator!()

bool ost::Date::operator! ( ) const
inline

◆ operator!=()

int ost::Date::operator!= ( const Date date)

◆ operator()()

String ost::Date::operator() ( ) const

◆ operator++()

Date & ost::Date::operator++ ( )

◆ operator+=()

Date & ost::Date::operator+= ( const long  val)

◆ operator--()

Date & ost::Date::operator-- ( )

◆ operator-=()

Date & ost::Date::operator-= ( const long  val)

◆ operator<()

int ost::Date::operator< ( const Date date)

◆ operator<=()

int ost::Date::operator<= ( const Date date)

◆ operator==()

int ost::Date::operator== ( const Date date)

◆ operator>()

int ost::Date::operator> ( const Date date)

◆ operator>=()

int ost::Date::operator>= ( const Date date)

◆ setDate()

void ost::Date::setDate ( const char *  str,
size_t  size = 0 
)

◆ toJulian()

void ost::Date::toJulian ( long  year,
long  month,
long  day 
)
protected

◆ update()

virtual void ost::Date::update ( void  )
protectedvirtual

A method to use to "post" any changed values when shadowing a mixed object class.

This is used by DateNumber.

Reimplemented in ost::DateNumber.

Friends And Related Symbol Documentation

◆ operator+ [1/2]

Date operator+ ( const Date date,
const long  val 
)
friend

◆ operator+ [2/2]

Date operator+ ( const long  val,
const Date date 
)
friend

◆ operator- [1/2]

Date operator- ( const Date date,
const long  val 
)
friend

◆ operator- [2/2]

Date operator- ( const long  val,
const Date date 
)
friend

Member Data Documentation

◆ julian

long ost::Date::julian
protected

The documentation for this class was generated from the following file: