UCommon
Public Member Functions | Protected Member Functions
ucommon::DateNumber Class Reference

A number class that manipulates a string buffer that is also a date. More...

#include <datetime.h>

Inheritance diagram for ucommon::DateNumber:
Inheritance graph
[legend]
Collaboration diagram for ucommon::DateNumber:
Collaboration graph
[legend]

Public Member Functions

 DateNumber (char *pointer)
 Create a date number tied to a refreshed string buffer. More...
 
void set (void)
 Set date number to current date.
 
virtual ~DateNumber ()
 Release a datenumber object.
 
- Public Member Functions inherited from ucommon::Number
const char * c_str () const
 Get string buffer representing the number. More...
 
long get () const
 Get value of string buffer as a long integer. More...
 
 Number (char *buffer, unsigned size)
 Create an instance of a number. More...
 
 operator char * () const
 Cast object as a string to retrieve buffer. More...
 
 operator long () const
 Cast string as long integer and get value of buffer. More...
 
bool operator!= (const long value) const
 
long operator() () const
 Get value of string buffer as expression of object. More...
 
long operator++ ()
 Increment the number object. More...
 
long operator+= (const long value)
 Add a value to the number. More...
 
long operator-- ()
 Decrement the number object. More...
 
long operator-= (const long value)
 Subtract a value from the number. More...
 
bool operator< (const long value) const
 
bool operator<= (const long value) const
 
long operator= (long value)
 Assign a value to the number. More...
 
long operator= (const Number &number)
 Assign another number to this number. More...
 
bool operator== (const long value) const
 
bool operator> (const long value) const
 
bool operator>= (const long value) const
 
void set (long value)
 Set string based on a new value. More...
 
- Public Member Functions inherited from ucommon::Date
 Date (time_t value)
 Create a julian date from a time_t type. More...
 
 Date (const struct tm *object)
 Create a julian date from a local or gmt date and time. More...
 
 Date (const char *pointer, size_t size=0)
 Create a julian date from a ISO date string of a specified size. More...
 
 Date (int year, unsigned month, unsigned day)
 Create a julian date from an arbitrary year, month, and day. More...
 
 Date (const Date &object)
 Create a julian date object from another object. More...
 
 Date ()
 Construct a new julian date with today's date.
 
unsigned day (void) const
 Get the day of the month of the date. More...
 
unsigned dow (void) const
 Get the day of the week (0-7). More...
 
long get (void) const
 Get the date as a number for the object or 0 if invalid. More...
 
bool is_valid (void) const
 Check if date is valid. More...
 
unsigned month (void) const
 Get the month of the date (1-12). More...
 
long operator * () const
 Access julian value. More...
 
 operator bool () const
 Check if julian date is valid for is() expression. More...
 
 operator long () const
 Casting operator to return date as number. More...
 
bool operator! () const
 Check if julian date is not valid. More...
 
bool operator!= (const Date &date) const
 Compare julian dates if not same date. More...
 
stringref_t operator() () const
 Expression operator to return an ISO date string for the current julian date. More...
 
const Date operator+ (long days) const
 Add days to julian date in an expression. More...
 
Dateoperator++ ()
 Increment date by one day. More...
 
Dateoperator+= (long offset)
 Increment date by offset. More...
 
const Date operator- (long days) const
 Subtract days from a julian date in an expression. More...
 
long operator- (const Date &date)
 Operator to compute number of days between two dates. More...
 
Dateoperator-- ()
 Decrement date by one day. More...
 
Dateoperator-= (long offset)
 Decrement date by offset. More...
 
bool operator< (const Date &date) const
 Compare julian date if earlier than another date. More...
 
bool operator<= (const Date &date) const
 Compare julian date if earlier than or equal to another date. More...
 
Dateoperator= (const Date &date)
 Assign date from another date object. More...
 
bool operator== (const Date &date) const
 Compare julian dates if same date. More...
 
bool operator> (const Date &date) const
 Compare julian date if later than another date. More...
 
bool operator>= (const Date &date) const
 Compare julian date if later than or equal to another date. More...
 
const char * put (char *buffer) const
 Get a ISO string representation of the date (yyyy-mm-dd). More...
 
void set (void)
 Set (update) the date with current date.
 
void set (const char *pointer, size_t size=0)
 Set the julian date based on an ISO date string of specified size. More...
 
time_t timeref (void) const
 Get a time_t for the julian date if in time_t epoch. More...
 
int year (void) const
 Get the year of the date. More...
 
virtual ~Date ()
 Destroy julian date object.
 

Protected Member Functions

virtual void update (void)
 A method to use to "post" any changed values when shadowing a mixed object class. More...
 
- Protected Member Functions inherited from ucommon::Date
void set (long year, long month, long day)
 

Additional Inherited Members

- Static Public Attributes inherited from ucommon::Date
static const size_t sz_string
 Size of date string field.
 
- Protected Attributes inherited from ucommon::Number
char * buffer
 
unsigned size
 
- Protected Attributes inherited from ucommon::Date
long julian
 

Detailed Description

A number class that manipulates a string buffer that is also a date.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m a number that is also a date string.

Definition at line 971 of file datetime.h.

Constructor & Destructor Documentation

◆ DateNumber()

ucommon::DateNumber::DateNumber ( char *  pointer)

Create a date number tied to a refreshed string buffer.

Parameters
pointerto string buffer to rewrite.

Member Function Documentation

◆ update()

virtual void ucommon::DateNumber::update ( void  )
protectedvirtual

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

This is used by DateNumber and string classes.

Reimplemented from ucommon::Date.


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