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

The class is an RFC-iCalendar RECUR object. More...

#include </home/doug/src/SoftwareAndServices/libSaSiCalendar/recur.hpp>

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

Classes

class  weekdaynum
 WEEKDAYNUM (51 week, 2nd from last week, ...) More...
 

Public Types

enum  frequency {
  UNKNOWN_t = UnknownToken_t, SECONDLY_t = SECONDLY, MINUTELY_t = MINUTELY, HOURLY_t = HOURLY,
  DAILY_t = DAILY, WEEKLY_t = WEEKLY, MONTHLY_t = MONTHLY, YEARLY_t = YEARLY
}
 freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY" 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...
 
enum  weekday {
  SU_t = SU, MO_t = MO, TU_t = TU, WE_t = WE,
  TH_t = TH, FR_t = FR, SA_t = SA
}
 Sunday, Monday, ... More...
 

Public Member Functions

 recur (frequency freq=UNKNOWN_t)
 recur Constructor. More...
 
virtual ~recur ()
 recur Destructor. More...
 
bool addXValue (const text *name, const text *val)
 Add a value to this object that is an experimental type. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance. More...
 
const valuegetData () const
 Get the pointer to the data being stored. More...
 
virtual InstanceCount_t getInstance () const
 
propertyVec * getInstanceArray (iCalendar *ical, const date_time *start, unsigned int inst_count=0) const
 getInstanceArray() Expand the current object into instances. More...
 
propertyVec * getInstanceArray (iCalendar *ical, const date_time *start, const date_time *until=NULL) const
 getInstanceArray() Expand the current object into instances. More...
 
date_timegetNthInstance (const date_time *start, unsigned int nTh) const
 Return the date_time of the Nth instance of this object. More...
 
Tokens_t getType () const
 Get the type of data being stored. More...
 
const char * getXValueType () const
 Get the type of data being stored. More...
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
bool isBounded () const
 
unsigned int maxInstanceExpansion () const
 
void operator delete (void *data)
 This class uses instance counting, this entry point overloads the default delete() operator in order to correctly track the instance. More...
 
bool parse (Parse &in, component *)
 #Parse a recur value. More...
 
bool parse (const char *in, component *errors)
 #Parse an recur value. More...
 
void setData (void *DataPtr)
 Set the data to the data being stored. 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...
 
virtual bool sprint (String *Results) const
 Print the object in RFC-iCalendar format. More...
 
bool valid () const
 Validate the recur value. 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 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...
 

Public Attributes

vector< int > * byhrlist
 
vector< int > * byminlist
 
vector< int > * bymodaylist
 
vector< int > * bymonlist
 
vector< int > * byseclist
 
vector< int > * bysplist
 
vector< weekdaynum * > * bywdaylist
 
vector< int > * bywknolist
 
vector< int > * byyrdaylist
 
unsigned int count
 
frequency freq
 
unsigned int interval
 
dateuntilDate
 
date_timeuntilDateTime
 
Tokens_t wkst
 
valuexValueList
 

Static Public Attributes

static const char ** tokenStrings
 A list of strings for the names of tokens. More...
 

Detailed Description

The class is an RFC-iCalendar RECUR object.

Definition at line 84 of file recur.hpp.

Member Enumeration Documentation

◆ frequency

freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY"

Definition at line 94 of file recur.hpp.

◆ quote_errors

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

Definition at line 204 of file BaseValueType.hpp.

◆ weekday

Sunday, Monday, ...

Saturday

Definition at line 109 of file recur.hpp.

Constructor & Destructor Documentation

◆ recur()

SoftwareAndServices::Library::iCalendar::recur::recur ( frequency  freq = UNKNOWN_t)

recur Constructor.

Parameters
freqThe frequency of the recurrence.

◆ ~recur()

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

recur 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.

◆ addXValue()

bool SoftwareAndServices::Library::iCalendar::recur::addXValue ( const text name,
const text val 
)

Add a value to this object that is an experimental type.

Parameters
nameThe name of the experimental value.
valThe experimental value.
Returns
TRUE if added.

◆ decInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< BaseValueType >::decInstance ( ) const
inlinevirtualinherited

Decrement the instance.

Returns
The instance count, after decrementing it.

Reimplemented in SoftwareAndServices::Library::iCalendar::date_time.

Definition at line 129 of file instance.hpp.

◆ 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.

◆ 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()

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

Definition at line 118 of file instance.hpp.

◆ getInstanceArray() [1/2]

propertyVec* SoftwareAndServices::Library::iCalendar::recur::getInstanceArray ( iCalendar ical,
const date_time start,
unsigned int  inst_count = 0 
) const

getInstanceArray() Expand the current object into instances.

Parameters
icalThe iCalendar object that is being expanded. This is needed in some cases when additional properties need to be examined.
startThe inclusive start dtstart to start the search or expansion of instances.
inst_countThe number of instances to find. If maxInstanceExpansion() is unlimited then you MUST supply inst_count. If maxInstanceExpansion() greater than zero and inst_count is zero, then up to maxInstanceExpansion() objects (if the current object has that many) will be returned.
Returns
Returns a propertyVec pointer of date or date_time objects that MUST BE deleted when the caller is finished with them.

◆ getInstanceArray() [2/2]

propertyVec* SoftwareAndServices::Library::iCalendar::recur::getInstanceArray ( iCalendar ical,
const date_time start,
const date_time until = NULL 
) const

getInstanceArray() Expand the current object into instances.

Parameters
icalThe iCalendar object that is being expanded. This is needed in some cases when additional properties need to be examined.
startThe inclusive start DATE-TIME to start the search or expansion of instances.
untilthe number of instances to find. If maxInstanceExpansion() is unlimited then you MUST supply until. If maxInstanceExpansion() greater than zero and until is NULL, then up to maxInstanceExpansion() objects (if the current object has that many) will be returned.
Returns
Returns a propertyVec pointer of date or date_time objects that MUST BE deleted when the caller is finished with them.

◆ getNthInstance()

date_time* SoftwareAndServices::Library::iCalendar::recur::getNthInstance ( const date_time start,
unsigned int  nTh 
) const

Return the date_time of the Nth instance of this object.

Caller MUST delete results when done.

Parameters
startThe dtstart value of this component.
nThWhich of the instances to get.
Returns
NULL when it is not a valid 'N'th. (Try calling instanceCount() or maxInstanceExpansion() );

◆ 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()

◆ 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()

◆ incInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< BaseValueType >::incInstance ( ) const
inlinevirtualinherited

Increment the instance.

Returns
The instance value, after incrementing it.

Reimplemented in SoftwareAndServices::Library::iCalendar::date_time.

Definition at line 109 of file instance.hpp.

◆ isBounded()

bool SoftwareAndServices::Library::iCalendar::recur::isBounded ( ) const
Returns
TRUE when the number of instances of this recur value are not infinite.

◆ maxInstanceExpansion()

unsigned int SoftwareAndServices::Library::iCalendar::recur::maxInstanceExpansion ( ) const
Returns
The maximum number of instances this implementation will ever return. A zero means unlimited.

◆ operator delete()

void SoftwareAndServices::Library::iCalendar::BaseValueType::operator delete ( void *  data)
inherited

This class uses instance counting, this entry point overloads the default delete() operator in order to correctly track the instance.

◆ parse() [1/2]

bool SoftwareAndServices::Library::iCalendar::recur::parse ( Parse in,
component  
)

#Parse a recur value.

Parameters
inAn open Parse object.
errorsWhere to put any parsing errors.
Returns
TRUE when parsed successfully.

◆ parse() [2/2]

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

#Parse an recur value.

Parameters
inAn RFC-iCalendar period string value.
errorsWhere to put any parsing errors.
Returns
TRUE when parsed successfully.

◆ 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.

◆ setData()

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

Set the data to the data being stored.

Parameters
DataPtrPointer to the data.

◆ 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()

◆ sprint()

virtual bool SoftwareAndServices::Library::iCalendar::recur::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.

◆ 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.

◆ 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()

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

Validate the recur value.

Returns
TRUE if this recur object contents are valid.

Member Data Documentation

◆ 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: