Software and Services, Portable Libraries  2019.Mar.01
A library for managing digital certificates
SoftwareAndServices::Library::iCalendar::date_time Class Reference

An RFC-iCalendar implementation of a DATE-TIME parameter. More...

+ Inheritance diagram for SoftwareAndServices::Library::iCalendar::date_time:
+ Collaboration diagram for SoftwareAndServices::Library::iCalendar::date_time:

Public Types

enum  DayOfTheWeek_e {
  Sunday_t = 0, Monday_t, Tuesday_t, Wednesday_t,
  Thursday_t, Friday_t, Saturday_t
}
 Days of the week as an enumerated value. More...
 
enum  Month_e {
  January_t = 1, February_t, March_t, April_t,
  June_t, July_t, August_t, September_t,
  October_t, November_t, December_t
}
 Months of the year. More...
 
enum  quote_errors { NO_END_QUOTE_e = 1, NO_DATA_PROVIDED_e, UNKNOWN_BACKSLASH_ESCAPE_e, NO_TERM_FOUND_e }
 These are C++ objects that can be thrown as errors. More...
 

Public Member Functions

 date_time ()
 date_time Constructor. More...
 
 date_time (const char *isoDt)
 date_time Constructor from an ISO date time string. More...
 
 date_time (date &ExistingDate, time &ExistingTime, bool isZ=false)
 date_time Constructor. More...
 
 date_time (DateTime &dt, bool isZ=false)
 date_time Copy Constructor. More...
 
 date_time (unsigned short Year, unsigned char Month, unsigned char Day, unsigned char Hour, unsigned char Minute, unsigned char Second, bool isZ=false)
 date_time Constructor. More...
 
 date_time (unsigned short Year, unsigned char Month, unsigned char Hour, bool isZ=false)
 date_time Constructor. More...
 
 date_time (date &CopyFromDate, bool isZ=false)
 date_time Constructor. More...
 
 date_time (struct tm *tmValue)
 date_time Constructor. More...
 
virtual ~date_time ()
 date_time Destructor. More...
 
unsigned char Day () const
 Get Month. More...
 
bool Day (unsigned char day)
 Set Day. More...
 
DayOfTheWeek_e DayOfWeek () const
 Get the day of the week. More...
 
int DayOfYear () const
 
int DaysPerMonth () const
 
int DaysPerYear () const
 
InstanceCount_t decInstance () const
 
                              This class uses instance counting, this entry

point simply bumps up the counter. More...

 
DayOfTheWeek_e FirstDayOfMonth () const
 
const valuegetData () const
 Get the pointer to the data being stored. More...
 
virtual InstanceCount_t getInstance () const
 
virtual InstanceCount_t getInstance () const
 
Tokens_t getType () const
 Get the type of data being stored. More...
 
const char * getTzid () const
 
long getTzOffset () const
 
const char * getXValueType () const
 Get the type of data being stored. More...
 
time_t GmtTimeT ()
 Get a time_t for the current object value. More...
 
unsigned char Hour () const
 Get Hour. More...
 
bool Hour (unsigned char hour)
 Set Hour. More...
 
InstanceCount_t incInstance () const
 
                              This class uses instance counting, this entry

point simply bumps up the counter. More...

 
bool IsDateOnly () const
 
bool IsLeapYear () const
 
bool IsTimeOnly () const
 
bool isZ () const
 
bool IsZ () const
 
unsigned char Minute () const
 Get Minute. More...
 
bool Minute (unsigned char minute)
 Set Minute. More...
 
unsigned char Month () const
 Get Month. More...
 
bool Month (unsigned char month)
 Set Month. More...
 
const char * MonthName () const
 Return the abbreviated month name. More...
 
const char * MonthNameFull () const
 Return the month name. More...
 
void Normalize ()
 Take the (struct tm) value in 'this' and normalize the other values. More...
 
void operator delete (void *data)
 The delete operator for this object. More...
 
bool operator!= (const DateTime Other) const
 The DateTime compare operator. More...
 
bool operator< (const DateTime Other) const
 The DateTime compare operator. More...
 
bool operator<= (const DateTime Other) const
 The DateTime compare operator. More...
 
bool operator== (const DateTime Other) const
 The DateTime compare operator. More...
 
bool operator> (const DateTime Other) const
 The DateTime compare operator. More...
 
bool operator>= (const DateTime Other) const
 The DateTime compare operator. More...
 
bool parse (const char *iso)
 Parse an ISO DATE-TIME string. More...
 
bool parse (SoftwareAndServices::Library::Common::Parse &in, component *errors)
 Parse an ISO date_time. More...
 
bool parse (const char *in, component *errors)
 Parse an ISO date_time. More...
 
bool Parse (const char *isoDateTime)
 Parse ISO (or iCAL date / date-time) More...
 
unsigned char Second () const
 Get Seconds. More...
 
bool Second (unsigned char second)
 Set Seconds. More...
 
void setData (void *DataPtr)
 Set the data to the data being stored. More...
 
void SetDateOnly ()
 Signify that the time part should be ignored. More...
 
void SetTimeOnly ()
 Signify that the date part should be ignored. More...
 
void setType (Tokens_t Token)
 Set the type of data being stored. More...
 
void setXValueType (const char *xValType)
 Set the type of data being stored - non-standard types only. More...
 
void setZ (bool isZ)
 Set (or unset) a flag indicating that this object is in GMT time zone. More...
 
void setZ (bool isZ, const char *NewTzId, iCalendar *iCal)
 Set (or unset) a flag indicating that this object is in GMT time zone. More...
 
void setZ (bool isZ, const char *NewTzId, long offset)
 Set (or unset) a flag indicating that this object is in GMT time zone. More...
 
void SetZ (bool isZ)
 
void SetZ (bool isZ, const char *newTzName, long tzOffset)
 
virtual bool sprint (String *Results) const
 Print the object in RFC-iCalendar format. More...
 
virtual bool Sprint (String *Results) const
 Prints Only HHMMSS if Year, Month, and Day are zero. More...
 
virtual bool Sprint (String &Results) const
 Prints Only HHMMSS if Year, Month, and Day are zero. More...
 
int TimeZoneOffset () const
 
bool ToNowLocal ()
 Set the timezone to NOW in the current time zone. More...
 
bool ToNowZ ()
 Set the timezone to NOW in the GMT time zone. More...
 
virtual bool ToString (String &Results) const
 Prints Only HHMMSS if Year, Month, and Day are zero. More...
 
const char * Tzid () const
 
bool Tzid (const char *NewTzId)
 Set the TZID. More...
 
long TzOffset () const
 
bool valid () const
 Check to make sure this date_time object has valid values (example: not Feb 30th). More...
 
virtual bool_t xdr (XDR *xdrs)
 Read/Write the string in XDR format. More...
 
unsigned short Year () const
 Get Year. More...
 
bool Year (unsigned short year)
 Set Month. More...
 

Static Public Member Functions

static char * addQuotes (const char *text)
 Add quotes to the value. More...
 
static char * escape (const char *text)
 Escape a value and return an RFC-iCalendar value encoded. More...
 
static const char * getMaxDate ()
 
static const char * getMinDate ()
 
static bool IsLeapYear (unsigned short year)
 
static char * removeQuotes (const char *text)
 Remove quotes from a user supplied value so that the raw data can be stored. More...
 
static bool sprintTokensAsText (String *Results, Tokens_t token)
 Called by text2token() to get the token name as a String. More...
 
static char * unescape (const char *text, const char *term)
 Un-escape a value and return what a user originally entered. More...
 
static bool valid (const date_time *DateTimeToCheck)
 Check to make sure the date_time object has valid values (example: not Feb 30th). More...
 
static bool_t xdr_DateTime (XDR *xdrs, DateTime *Pointer)
 Read/Write the String in XDR format. More...
 
static bool_t xdr_DateTime (XDR *xdrs, void *Pointer)
 Read/Write the String in XDR format. More...
 
static bool_t xdr_T (XDR *xdrs, DateTime *Pointer)
 Read/Write the XDR object. More...
 
static bool_t xdr_T (XDR *xdrs, void *Pointer)
 Read/Write the XDR object. More...
 

Static Public Attributes

static const char * Apr
 3 character abbrivation for April More...
 
static const char * April
 April. More...
 
static const char * Aug
 3 character abbrivation for August More...
 
static const char * August
 August. More...
 
static const char * Dec
 3 character abbrivation for December More...
 
static const char * December
 December. More...
 
static const char * Feb
 3 character abbrivation for Feburary More...
 
static const char * February
 Feburary. More...
 
static const char * Jan
 3 character abbrivation for January More...
 
static const char * January
 January. More...
 
static const char * Jul
 3 character abbrivation for July More...
 
static const char * July
 July. More...
 
static const char * Jun
 3 character abbrivation for June More...
 
static const char * June
 June. More...
 
static const char * Mar
 3 character abbrivation for March More...
 
static const char * March
 March. More...
 
static const char * May
 3 character abbrivation for May More...
 
static const char * Nov
 3 character abbrivation for November More...
 
static const char * November
 November. More...
 
static const char * Oct
 3 character abbrivation for October More...
 
static const char * October
 October. More...
 
static const char * Sep
 3 character abbrivation for September More...
 
static const char * September
 September. More...
 
static const char ** tokenStrings
 A list of strings for the names of tokens. More...
 

Detailed Description

An RFC-iCalendar implementation of a DATE-TIME parameter.

Definition at line 90 of file date_time.hpp.

Member Enumeration Documentation

◆ DayOfTheWeek_e

Days of the week as an enumerated value.

This have the same values as ((struct tm)->tm_wday).

Enumerator
Sunday_t 

Number used for Sunday.

Monday_t 

Number used for Monday.

Tuesday_t 

Number used for Tuesday.

Wednesday_t 

Number used for Wednesday.

Thursday_t 

Number used for Thursday.

Friday_t 

Number used for Friday.

Saturday_t 

Number used for Saturday.

Definition at line 226 of file DateTime.hpp.

◆ Month_e

Months of the year.

Enumerator
January_t 

January.

February_t 

Feburary.

March_t 

March.

April_t 

April.

June_t 

June.

July_t 

July.

August_t 

August.

September_t 

September.

October_t 

October.

November_t 

November.

December_t 

December.

Definition at line 185 of file DateTime.hpp.

◆ quote_errors

These are C++ objects that can be thrown as errors.

Definition at line 204 of file BaseValueType.hpp.

Constructor & Destructor Documentation

◆ date_time() [1/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( )

date_time Constructor.

◆ date_time() [2/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( const char *  isoDt)

date_time Constructor from an ISO date time string.

Parameters
isoDtAn ISO date time string.

◆ date_time() [3/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( date ExistingDate,
time ExistingTime,
bool  isZ = false 
)

date_time Constructor.

Parameters
ExistingDateInitialize the date part from here.
ExistingTimeInitialize the time part from here.
isZWhen TRUE, set time zone to GMT.

◆ date_time() [4/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( DateTime dt,
bool  isZ = false 
)

date_time Copy Constructor.

Parameters
isZWhen TRUE, set time zone to GMT.

◆ date_time() [5/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( unsigned short  Year,
unsigned char  Month,
unsigned char  Day,
unsigned char  Hour,
unsigned char  Minute,
unsigned char  Second,
bool  isZ = false 
)

date_time Constructor.

Parameters
YearThe year to initialize this to.
MonthThe year to initialize this to.
DayThe year to initialize this to.
HourThe year to initialize this to.
MinuteThe year to initialize this to.
SecondThe year to initialize this to.
isZWhen TRUE, set time zone to GMT.

◆ date_time() [6/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( unsigned short  Year,
unsigned char  Month,
unsigned char  Hour,
bool  isZ = false 
)

date_time Constructor.

Time set to zero.

Parameters
YearThe year to initialize this to.
MonthThe year to initialize this to.
DayThe year to initialize this to.
isZWhen TRUE, set time zone to GMT.

◆ date_time() [7/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( date CopyFromDate,
bool  isZ = false 
)

date_time Constructor.

Parameters
CopyFromDateCopy the date part from this object.
isZWhen TRUE, set time zone to GMT.

◆ date_time() [8/8]

SoftwareAndServices::Library::iCalendar::date_time::date_time ( struct tm *  tmValue)

date_time Constructor.

Parameters
tmValueThe struct tm value to copy from.

◆ ~date_time()

virtual SoftwareAndServices::Library::iCalendar::date_time::~date_time ( )
virtual

date_time Destructor.

Member Function Documentation

◆ addQuotes()

static char* SoftwareAndServices::Library::iCalendar::BaseValueType::addQuotes ( const char *  text)
staticinherited

Add quotes to the value.

Caller MUST free results.

Parameters
textThe text to be de-quoted.
Returns
The de-quoted data.

◆ Day() [1/2]

unsigned char SoftwareAndServices::Library::Common::DateTime::Day ( ) const
inherited

Get Month.

Returns
The objects day.

◆ Day() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Day ( unsigned char  day)
inherited

Set Day.

Parameters
dayThe objects day.
Returns
TRUE when the value is valid and set.

◆ DayOfWeek()

DayOfTheWeek_e SoftwareAndServices::Library::Common::DateTime::DayOfWeek ( ) const
inherited

Get the day of the week.

Returns
The objects day of the week as an enumerated value.

◆ DayOfYear()

int SoftwareAndServices::Library::Common::DateTime::DayOfYear ( ) const
inherited
Returns
The day number in the current year.

◆ DaysPerMonth()

int SoftwareAndServices::Library::Common::DateTime::DaysPerMonth ( ) const
inherited
Returns
Return the number of days in the current month.

◆ DaysPerYear()

int SoftwareAndServices::Library::Common::DateTime::DaysPerYear ( ) const
inherited
Returns
The number of days in the year.

◆ decInstance()

InstanceCount_t SoftwareAndServices::Library::iCalendar::date_time::decInstance ( ) const
virtual

                              This class uses instance counting, this entry

point simply bumps up the counter.

Returns
The current instance count.

Reimplemented from SoftwareAndServices::Library::Common::instance< BaseValueType >.

◆ escape()

static char* SoftwareAndServices::Library::iCalendar::BaseValueType::escape ( const char *  text)
staticinherited

Escape a value and return an RFC-iCalendar value encoded.

Caller MUST free results.

Parameters
textthe text to escape.
Returns
The escaped string.

◆ FirstDayOfMonth()

DayOfTheWeek_e SoftwareAndServices::Library::Common::DateTime::FirstDayOfMonth ( ) const
inherited
Returns
The day of the week for the 1st of the month as an enumerated type.

◆ getData()

const value* SoftwareAndServices::Library::iCalendar::BaseValueType::getData ( ) const
inherited

Get the pointer to the data being stored.

Returns
Pointer to the data being stored.

◆ getInstance() [1/2]

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< DateTime >::getInstance ( ) const
inlinevirtualinherited
Returns
The current instance count.

Definition at line 118 of file instance.hpp.

◆ getInstance() [2/2]

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< BaseValueType >::getInstance ( ) const
inlinevirtualinherited
Returns
The current instance count.

Definition at line 118 of file instance.hpp.

◆ getMaxDate()

static const char* SoftwareAndServices::Library::iCalendar::date_time::getMaxDate ( )
static
Returns
The Maximum date supported by this implementation.

◆ getMinDate()

static const char* SoftwareAndServices::Library::iCalendar::date_time::getMinDate ( )
static
Returns
The minimum date supported by this implementation.

◆ getType()

Tokens_t SoftwareAndServices::Library::iCalendar::BaseValueType::getType ( ) const
inherited

Get the type of data being stored.

If it returns Unknown_t, call getXType()

Returns
The type of data being stored.
See also
getXValueType()

◆ getTzid()

const char* SoftwareAndServices::Library::iCalendar::date_time::getTzid ( ) const
Returns
The time zone ID for this object.

◆ getTzOffset()

long SoftwareAndServices::Library::iCalendar::date_time::getTzOffset ( ) const
Returns
The time zone offset for this object.

◆ getXValueType()

const char* SoftwareAndServices::Library::iCalendar::BaseValueType::getXValueType ( ) const
inherited

Get the type of data being stored.

If it returns NULL, call getType()

Returns
The type of data being stored as a string.
See also
geXValueType()

◆ GmtTimeT()

time_t SoftwareAndServices::Library::Common::DateTime::GmtTimeT ( )
inherited

Get a time_t for the current object value.

The (struct tm) part of this object is updated and normalized.

Returns
The time_t value equal the current objects value.

◆ Hour() [1/2]

unsigned char SoftwareAndServices::Library::Common::DateTime::Hour ( ) const
inherited

Get Hour.

Returns
The objects hour.

◆ Hour() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Hour ( unsigned char  hour)
inherited

Set Hour.

Parameters
hourThe objects hour.
Returns
TRUE when the value is valid and set.

◆ incInstance()

InstanceCount_t SoftwareAndServices::Library::iCalendar::date_time::incInstance ( ) const
virtual

                              This class uses instance counting, this entry

point simply bumps up the counter.

Returns
The current instance count.

Reimplemented from SoftwareAndServices::Library::Common::instance< BaseValueType >.

◆ IsDateOnly()

bool SoftwareAndServices::Library::Common::DateTime::IsDateOnly ( ) const
inherited
Returns
TRUE when the time part is not set.

◆ IsLeapYear() [1/2]

bool SoftwareAndServices::Library::Common::DateTime::IsLeapYear ( ) const
inherited
Returns
TRUE when the year is a leap year.

◆ IsLeapYear() [2/2]

static bool SoftwareAndServices::Library::Common::DateTime::IsLeapYear ( unsigned short  year)
staticinherited
Parameters
yearA year to test to see if it is a leap year.
Returns
TRUE when the provided year is a leap year.

◆ IsTimeOnly()

bool SoftwareAndServices::Library::Common::DateTime::IsTimeOnly ( ) const
inherited
Returns
TRUE when the date part is not set.

◆ isZ()

bool SoftwareAndServices::Library::iCalendar::date_time::isZ ( ) const
Returns
TRUE when this object is in the GMT time zone.

◆ IsZ()

bool SoftwareAndServices::Library::Common::DateTime::IsZ ( ) const
inherited
Returns
TRUE when the current object is in the GMT time zone.

◆ Minute() [1/2]

unsigned char SoftwareAndServices::Library::Common::DateTime::Minute ( ) const
inherited

Get Minute.

Returns
The objects minute.

◆ Minute() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Minute ( unsigned char  minute)
inherited

Set Minute.

Parameters
minuteThe objects minute.
Returns
TRUE when the value is valid and set.

◆ Month() [1/2]

unsigned char SoftwareAndServices::Library::Common::DateTime::Month ( ) const
inherited

Get Month.

Returns
The objects month.

◆ Month() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Month ( unsigned char  month)
inherited

Set Month.

Parameters
monthThe objects month.
Returns
TRUE when the value is valid and set.

◆ MonthName()

const char* SoftwareAndServices::Library::Common::DateTime::MonthName ( ) const
inherited

Return the abbreviated month name.

Returns
The abbreviated name of the month as a localized string.

◆ MonthNameFull()

const char* SoftwareAndServices::Library::Common::DateTime::MonthNameFull ( ) const
inherited

Return the month name.

Returns
The name of the month as a localized string.

◆ Normalize()

void SoftwareAndServices::Library::Common::DateTime::Normalize ( )
inherited

Take the (struct tm) value in 'this' and normalize the other values.

This method allows you to set your desired interval into the values, then convert them to normal value.

Example, If you set seconds to 3600, then call normalize, it will set seconds to zero, minutes to zero, and increment hours by one.

Normalize only wraps up seconds, minutes, hours, monday day, month, and years. All other values are ignored in the calculations.

It also sets DayOfWeek and DayOfYear.

◆ operator delete()

void SoftwareAndServices::Library::iCalendar::date_time::operator delete ( void *  data)

The delete operator for this object.

Only deletes the object when the instance count is zero.

◆ operator!=()

bool SoftwareAndServices::Library::Common::DateTime::operator!= ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when they are NOT equal.

◆ operator<()

bool SoftwareAndServices::Library::Common::DateTime::operator< ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when THIS is less than Other

◆ operator<=()

bool SoftwareAndServices::Library::Common::DateTime::operator<= ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when THIS is less than or equal to Other

◆ operator==()

bool SoftwareAndServices::Library::Common::DateTime::operator== ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when they are equal.

◆ operator>()

bool SoftwareAndServices::Library::Common::DateTime::operator> ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when THIS is more than Other

◆ operator>=()

bool SoftwareAndServices::Library::Common::DateTime::operator>= ( const DateTime  Other) const
inherited

The DateTime compare operator.

Parameters
OtherThe DateTime to compare to.
Returns
TRUE when THIS is more then or equal to Other

◆ parse() [1/3]

bool SoftwareAndServices::Library::iCalendar::date_time::parse ( const char *  iso)

Parse an ISO DATE-TIME string.

Returns
TRUE when successfully parsed.

◆ parse() [2/3]

bool SoftwareAndServices::Library::iCalendar::date_time::parse ( SoftwareAndServices::Library::Common::Parse in,
component errors 
)

Parse an ISO date_time.

Parameters
inAn open Parse object.
errorsWhere to put any parse errors.
Returns
TRUE when successful.

◆ parse() [3/3]

bool SoftwareAndServices::Library::iCalendar::date_time::parse ( const char *  in,
component errors 
)

Parse an ISO date_time.

Parameters
inA C string representing an ISO date_time.
errorsWhere to put any parse errors.
Returns
TRUE when successful.

◆ Parse()

bool SoftwareAndServices::Library::Common::DateTime::Parse ( const char *  isoDateTime)
inherited

Parse ISO (or iCAL date / date-time)

Parameters
isoDateTimeParse one of the following formats:
  • YYYY-MM-DD HH:MM
  • YYYY-MM-DD HH:MMZ
  • YYYY-MM-DD HH:MM:SS
  • YYYY-MM-DD HH:MM:SSZ
  • YYYYMMDDTHHMM
  • YYYYMMDDTHHMMZ
  • YYYYMMDDTHHMMSS
  • YYYYMMDDTHHMMSSZ
  • YYYY-MM-DD
  • YYYYMMDD
  • HH:MM:SS (NOT SUPPORTED - No DATE VALUE)
  • HH:MM (NOT SUPPORTED - No DATE VALUE)
  • HHMMSS (NOT SUPPORTED - No DATE VALUE)
Returns
TRUE if successful. FALSE if it can not be parsed. If FALSE the contents of this object are undefined.

◆ removeQuotes()

static char* SoftwareAndServices::Library::iCalendar::BaseValueType::removeQuotes ( const char *  text)
staticinherited

Remove quotes from a user supplied value so that the raw data can be stored.

Caller MUST free results.

Parameters
textThe text to be de-quoted. No harm if it does not already contain quotes.
Returns
The de-quoted data.

◆ Second() [1/2]

unsigned char SoftwareAndServices::Library::Common::DateTime::Second ( ) const
inherited

Get Seconds.

Returns
The objects seconds.

◆ Second() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Second ( unsigned char  second)
inherited

Set Seconds.

Parameters
secondThe objects seconds.
Returns
TRUE when the value is valid and set.

◆ setData()

void SoftwareAndServices::Library::iCalendar::BaseValueType::setData ( void *  DataPtr)
inherited

Set the data to the data being stored.

Parameters
DataPtrPointer to the data.

◆ SetDateOnly()

void SoftwareAndServices::Library::Common::DateTime::SetDateOnly ( )
inherited

Signify that the time part should be ignored.

◆ SetTimeOnly()

void SoftwareAndServices::Library::Common::DateTime::SetTimeOnly ( )
inherited

Signify that the date part should be ignored.

◆ setType()

void SoftwareAndServices::Library::iCalendar::BaseValueType::setType ( Tokens_t  Token)
inherited

Set the type of data being stored.

If the type is not a predefined one, call setXValueType()

Parameters
TokenThe type of data being stored.
See also
setXValueType()

◆ setXValueType()

void SoftwareAndServices::Library::iCalendar::BaseValueType::setXValueType ( const char *  xValType)
inherited

Set the type of data being stored - non-standard types only.

If the type is a predefined one, call setValueType()

Parameters
xValTypeThe type of data being stored as a string.
See also
setValueType()

◆ setZ() [1/3]

void SoftwareAndServices::Library::iCalendar::date_time::setZ ( bool  isZ)

Set (or unset) a flag indicating that this object is in GMT time zone.

Parameters
isZWhen TRUE, set this object to the GMT time zone.

◆ setZ() [2/3]

void SoftwareAndServices::Library::iCalendar::date_time::setZ ( bool  isZ,
const char *  NewTzId,
iCalendar iCal 
)

Set (or unset) a flag indicating that this object is in GMT time zone.

Parameters
isZWhen TRUE, set this object to the GMT time zone.
NewTzIdWhen isZ is FALSE and NewTzId is non-null, set to this time zone ID.
iCalWhen isZ is false and NewTzId is NULL, and iCal is non-null, set to the VTIMEZONE in iCal.

◆ setZ() [3/3]

void SoftwareAndServices::Library::iCalendar::date_time::setZ ( bool  isZ,
const char *  NewTzId,
long  offset 
)

Set (or unset) a flag indicating that this object is in GMT time zone.

Parameters
isZWhen TRUE, set this object to the GMT time zone.
NewTzIdWhen isZ is FALSE and NewTzId is non-null, set to this time zone ID.
offsetWhen isZ is false and NewTzId is NULL, set the time zone offset to 'offset'.

◆ SetZ() [1/2]

void SoftwareAndServices::Library::Common::DateTime::SetZ ( bool  isZ)
inherited
Parameters
isZSet to TRUE if you want the current object in GMT. Set to FALSE if you want the current object in the local or named time zone.

◆ SetZ() [2/2]

void SoftwareAndServices::Library::Common::DateTime::SetZ ( bool  isZ,
const char *  newTzName,
long  tzOffset 
)
inherited
Parameters
isZWhen TRUE, set to the GMT time zone and ignore the other parameters.
newTzNameOptional parameter. The name of the time zone to use (ignored if isZ is TRUE). Set to nullptr if not used.
tzOffsetOptional parameter. The time zone offset to use. (ignored if isZ is TRUE or newTzName is set).

◆ sprint()

virtual bool SoftwareAndServices::Library::iCalendar::date_time::sprint ( String Results) const
virtual

Print the object in RFC-iCalendar format.

Parameters
ResultsAppend the results to Results.
Returns
TRUE when data was appended.

Implements SoftwareAndServices::Library::iCalendar::BaseValueType.

◆ Sprint() [1/2]

virtual bool SoftwareAndServices::Library::Common::DateTime::Sprint ( String Results) const
virtualinherited

Prints Only HHMMSS if Year, Month, and Day are zero.

Prints YYYYMMDD if IsDateOnly() is set. Else prints YYYYMMDDTHHMMSS.

Parameters
ResultsThe formatted DateTime.
Returns
TRUE when something appended to Results.

◆ Sprint() [2/2]

virtual bool SoftwareAndServices::Library::Common::DateTime::Sprint ( String Results) const
virtualinherited

Prints Only HHMMSS if Year, Month, and Day are zero.

Prints YYYYMMDD if IsDateOnly() is set. Else prints YYYYMMDDTHHMMSS.

Parameters
ResultsThe formatted DateTime.
Returns
TRUE when something appended to Results.

◆ sprintTokensAsText()

static bool SoftwareAndServices::Library::iCalendar::BaseValueType::sprintTokensAsText ( String Results,
Tokens_t  token 
)
staticinherited

Called by text2token() to get the token name as a String.

Parameters
ResultsThe token name as a String.
tokenThe token to convert to a string.
Returns
TRUE when something appended to Results.

◆ ToNowLocal()

bool SoftwareAndServices::Library::Common::DateTime::ToNowLocal ( )
inherited

Set the timezone to NOW in the current time zone.

Returns
TRUE when set.

◆ ToNowZ()

bool SoftwareAndServices::Library::Common::DateTime::ToNowZ ( )
inherited

Set the timezone to NOW in the GMT time zone.

Returns
TRUE when set.

◆ ToString()

virtual bool SoftwareAndServices::Library::Common::DateTime::ToString ( String Results) const
virtualinherited

Prints Only HHMMSS if Year, Month, and Day are zero.

Prints YYYYMMDD if IsDateOnly() is set. Else prints YYYYMMDDTHHMMSS.

Parameters
ResultsThe formatted DateTime.
Returns
TRUE when something appended to Results.

◆ Tzid() [1/2]

const char* SoftwareAndServices::Library::Common::DateTime::Tzid ( ) const
inherited
Returns
The timezone id (example "America/Los_Angles").

◆ Tzid() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Tzid ( const char *  NewTzId)
inherited

Set the TZID.

Parameters
NewTzIdThe new Time Zone ID to use. Set to empty string "", to have this object set to local computer time.
Returns
true when NewTzId is accepted and set. Else returns false and no change is made.

◆ TzOffset()

long SoftwareAndServices::Library::Common::DateTime::TzOffset ( ) const
inherited
Returns
The timezone offset in seconds from GMT>

◆ unescape()

static char* SoftwareAndServices::Library::iCalendar::BaseValueType::unescape ( const char *  text,
const char *  term 
)
staticinherited

Un-escape a value and return what a user originally entered.

Caller MUST delete results when done. The string would have been encoded as an RFC-iCalendar value encoding.

Parameters
textthe text to un-escape.
termA string to be used as the data separator. This value is passed to strpbrk().
Returns
The un-escaped string.

◆ valid() [1/2]

static bool SoftwareAndServices::Library::iCalendar::date_time::valid ( const date_time DateTimeToCheck)
static

Check to make sure the date_time object has valid values (example: not Feb 30th).

Parameters
DateTimeToCheckThe date_time object to check.
Returns
TRUE when it is valid.

◆ valid() [2/2]

bool SoftwareAndServices::Library::iCalendar::date_time::valid ( ) const

Check to make sure this date_time object has valid values (example: not Feb 30th).

Returns
TRUE when it is valid.

◆ xdr()

virtual bool_t SoftwareAndServices::Library::Common::DateTime::xdr ( XDR xdrs)
virtualinherited

Read/Write the string in XDR format.

Parameters
xdrsAn initialized XDR object.

Implements SoftwareAndServices::Library::Common::XdrSerialize< DateTime >.

◆ xdr_DateTime() [1/2]

static bool_t SoftwareAndServices::Library::Common::DateTime::xdr_DateTime ( XDR xdrs,
DateTime Pointer 
)
staticinherited

Read/Write the String in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_DateTime() [2/2]

static bool_t SoftwareAndServices::Library::Common::DateTime::xdr_DateTime ( XDR xdrs,
void *  Pointer 
)
staticinherited

Read/Write the String in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_T() [1/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< DateTime >::xdr_T ( XDR xdrs,
DateTime Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

◆ xdr_T() [2/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< DateTime >::xdr_T ( XDR xdrs,
void *  Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

◆ Year() [1/2]

unsigned short SoftwareAndServices::Library::Common::DateTime::Year ( ) const
inherited

Get Year.

Returns
The objects year.

◆ Year() [2/2]

bool SoftwareAndServices::Library::Common::DateTime::Year ( unsigned short  year)
inherited

Set Month.

Parameters
yearThe objects year.
Returns
TRUE when the value is valid and set.

Member Data Documentation

◆ Apr

const char* SoftwareAndServices::Library::Common::DateTime::Apr
staticinherited

3 character abbrivation for April

Definition at line 123 of file DateTime.hpp.

◆ April

const char* SoftwareAndServices::Library::Common::DateTime::April
staticinherited

April.

Definition at line 159 of file DateTime.hpp.

◆ Aug

const char* SoftwareAndServices::Library::Common::DateTime::Aug
staticinherited

3 character abbrivation for August

Definition at line 135 of file DateTime.hpp.

◆ August

const char* SoftwareAndServices::Library::Common::DateTime::August
staticinherited

August.

Definition at line 168 of file DateTime.hpp.

◆ Dec

const char* SoftwareAndServices::Library::Common::DateTime::Dec
staticinherited

3 character abbrivation for December

Definition at line 147 of file DateTime.hpp.

◆ December

const char* SoftwareAndServices::Library::Common::DateTime::December
staticinherited

December.

Definition at line 180 of file DateTime.hpp.

◆ Feb

const char* SoftwareAndServices::Library::Common::DateTime::Feb
staticinherited

3 character abbrivation for Feburary

Definition at line 117 of file DateTime.hpp.

◆ February

const char* SoftwareAndServices::Library::Common::DateTime::February
staticinherited

Feburary.

Definition at line 153 of file DateTime.hpp.

◆ Jan

const char* SoftwareAndServices::Library::Common::DateTime::Jan
staticinherited

3 character abbrivation for January

Definition at line 114 of file DateTime.hpp.

◆ January

const char* SoftwareAndServices::Library::Common::DateTime::January
staticinherited

January.

Definition at line 150 of file DateTime.hpp.

◆ Jul

const char* SoftwareAndServices::Library::Common::DateTime::Jul
staticinherited

3 character abbrivation for July

Definition at line 132 of file DateTime.hpp.

◆ July

const char* SoftwareAndServices::Library::Common::DateTime::July
staticinherited

July.

Definition at line 165 of file DateTime.hpp.

◆ Jun

const char* SoftwareAndServices::Library::Common::DateTime::Jun
staticinherited

3 character abbrivation for June

Definition at line 129 of file DateTime.hpp.

◆ June

const char* SoftwareAndServices::Library::Common::DateTime::June
staticinherited

June.

Definition at line 162 of file DateTime.hpp.

◆ Mar

const char* SoftwareAndServices::Library::Common::DateTime::Mar
staticinherited

3 character abbrivation for March

Definition at line 120 of file DateTime.hpp.

◆ March

const char* SoftwareAndServices::Library::Common::DateTime::March
staticinherited

March.

Definition at line 156 of file DateTime.hpp.

◆ May

const char* SoftwareAndServices::Library::Common::DateTime::May
staticinherited

3 character abbrivation for May

Definition at line 126 of file DateTime.hpp.

◆ Nov

const char* SoftwareAndServices::Library::Common::DateTime::Nov
staticinherited

3 character abbrivation for November

Definition at line 144 of file DateTime.hpp.

◆ November

const char* SoftwareAndServices::Library::Common::DateTime::November
staticinherited

November.

Definition at line 177 of file DateTime.hpp.

◆ Oct

const char* SoftwareAndServices::Library::Common::DateTime::Oct
staticinherited

3 character abbrivation for October

Definition at line 141 of file DateTime.hpp.

◆ October

const char* SoftwareAndServices::Library::Common::DateTime::October
staticinherited

October.

Definition at line 174 of file DateTime.hpp.

◆ Sep

const char* SoftwareAndServices::Library::Common::DateTime::Sep
staticinherited

3 character abbrivation for September

Definition at line 138 of file DateTime.hpp.

◆ September

const char* SoftwareAndServices::Library::Common::DateTime::September
staticinherited

September.

Definition at line 171 of file DateTime.hpp.

◆ tokenStrings

const char** SoftwareAndServices::Library::iCalendar::BaseValueType::tokenStrings
staticinherited

A list of strings for the names of tokens.

The token value used as an offset into this array is the name of the token as a string.

The strings "X_COMP", "X_PROP", and "XPARAM" ARE included. Strings matching X_COMP, X_PROP, and XPARAM values are not included.

Definition at line 144 of file BaseValueType.hpp.


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