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

Base class for all RFC-iCalendar components. More...

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

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

Public Member Functions

 component (Tokens_t type)
 Constructor - create a component of 'type'. More...
 
 component (component &CopyFrom)
 Copy constructor. More...
 
virtual ~component ()
 component - Destructor. More...
 
virtual bool add (const property *newProperty)
 Add any property to this component. More...
 
virtual bool add (const component *NewComp)
 Add a new component. More...
 
virtual bool add (iCalError *ErrorToAdd)
 Add an error to this component. More...
 
bool addDtstamp (const dtstamp *TimeStamp=NULL)
 
virtual bool addIfNew (const property *newProperty)
 Add any property to this component, if a component of that same type is not already in this component. More...
 
virtual bool addIfNew (const component *NewComp)
 Add a new component - but only if this component type is not already in this component. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance counter for included objects as well as this object. More...
 
time_tVecgetAlarmArray (const date_time *start, const date_time *until)
 Get all valarm times that will go off from start time until 'until'. More...
 
componentgetComponent (const uid *uidValue) const
 Get the component that has a uid property, with a uidValue. More...
 
componentgetComponent (const char *uidValue) const
 Get the component that has a uid property, with a uidValue. More...
 
componentgetComponent (unsigned int offset) const
 
componentgetComponent (Tokens_t CompTypeToFind, unsigned int nTh) const
 Get the nTh component of type CompTypeToFind. More...
 
componentgetComponent (const char *xName, unsigned int nTh) const
 Get the nTh non-standard component of type xName. More...
 
unsigned int getComponentCount () const
 
unsigned int getComponentCount (Tokens_t OfType) const
 
Tokens_t getComponentType () const
 
iCalErrorVec * getErrorList () const
 
virtual InstanceCount_t getInstance () const
 Get the instance count for this object. More...
 
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...
 
propertygetProperty (unsigned int nTh=0) const
 Remove the xx. More...
 
propertygetProperty (Tokens_t PropTypeToFind, unsigned int nTh) const
 Get the nTh property of type PropTypeToFind. More...
 
propertygetProperty (const char *xName, unsigned int nTh) const
 Get the nTh instance of a non-standard property - by name. More...
 
unsigned int getPropertyCount () const
 Get the number of properties in this component. More...
 
unsigned int getPropertyCount (Tokens_t PropTypeToCount) const
 Get the number of properties in this component, of type 'type'. More...
 
void * getUserData () const
 Get any user data stored - or NULL if none. More...
 
valarmgetValarm (int SequenceToFind) const
 Get the valarm in this component that has a sequence property with a value of SequenceToFind. More...
 
valarmgetValarm (const sequence *SequenceToFind) const
 Get the valarm in this component that has a sequence property with a value of SequenceToFind. More...
 
const char * getXComponentType () const
 
virtual InstanceCount_t incInstance () const
 Increment the instance counter for included objects as well as this object. More...
 
void operator delete (void *ToFree)
 component - delete operator. More...
 
virtual bool operator!= (const component &Other) const
 Compare two components for inequality. More...
 
virtual componentoperator= (const component &CopyFrom)
 Copy one component into another. More...
 
virtual bool operator== (const component &Other) const
 Compare two components for equality. More...
 
virtual bool parse (Parse &in, component *errors)
 Parse the component. More...
 
virtual bool parse (const char *in, component *errors)
 Parse the component. More...
 
bool removeComponent (Tokens_t CompTypeToRemove, unsigned int nTh)
 Remove the nTh instance of then component type. More...
 
bool removeComponent (const component *ComponentToRemove)
 
bool removeProperty (Tokens_t PropTypeToRemove, unsigned int nTh)
 Remove the nTh instance of then property type. More...
 
bool removeProperty (const property *PropertyToRemove)
 
void setComponentType (Tokens_t type)
 
void setComponentType (const char *xType, unsigned int len=0)
 
void setUserData (void *userData)
 This method allows the calling application to associate any user data with this component. More...
 
virtual bool sprint (String *Results) const
 
virtual bool valid () const
 Do basic checking to determine if the component is valid. More...
 

Public Attributes

componentVeccomponentList
 The list of components in this component. More...
 
propertyVec * propertyList
 The list of properties in this component. More...
 

Protected Member Functions

 component (const char *xname, size_t len)
 component - Constructor for an x-component. More...
 
bool _parse (Tokens_t newToken, property **newProp, Parse &in, component *errors)
 Parse. More...
 
bool validComponent (requiredList *propList, bool xpropAllowed=true, requiredList *compList=NULL, bool xcompAllowed=true)
 Do basic checking on this component. More...
 

Detailed Description

Base class for all RFC-iCalendar components.

Definition at line 98 of file component.hpp.

Constructor & Destructor Documentation

◆ component() [1/3]

SoftwareAndServices::Library::iCalendar::component::component ( const char *  xname,
size_t  len 
)
protected

component - Constructor for an x-component.

◆ component() [2/3]

SoftwareAndServices::Library::iCalendar::component::component ( Tokens_t  type)

Constructor - create a component of 'type'.

Parameters
typeThe type of component to create.

◆ component() [3/3]

SoftwareAndServices::Library::iCalendar::component::component ( component CopyFrom)

Copy constructor.

Parameters
CopyFromThe component to copy from. This does not increment the instance count, this makes a new copy.

◆ ~component()

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

component - Destructor.

Member Function Documentation

◆ _parse()

bool SoftwareAndServices::Library::iCalendar::component::_parse ( Tokens_t  newToken,
property **  newProp,
Parse in,
component errors 
)
protected

Parse.

Parameters
newToken
newProp
inAn open Parse object.
errorsA pointer to a component that will store any errors.
Returns
TRUE on success, else FALSE with errors possibly filled with errors.

◆ add() [1/3]

virtual bool SoftwareAndServices::Library::iCalendar::component::add ( const property newProperty)
virtual

Add any property to this component.

Parameters
newPropertyThe new property to add to this component.
Returns
TRUE if added without error.

◆ add() [2/3]

virtual bool SoftwareAndServices::Library::iCalendar::component::add ( const component NewComp)
virtual

Add a new component.

Parameters
NewCompthe new component to add to this component.
Returns
TRUE if added.

◆ add() [3/3]

virtual bool SoftwareAndServices::Library::iCalendar::component::add ( iCalError ErrorToAdd)
virtual

Add an error to this component.

Parameters
ErrorToAddThe error to add.
Returns
TRUE if added.

◆ addDtstamp()

bool SoftwareAndServices::Library::iCalendar::component::addDtstamp ( const dtstamp TimeStamp = NULL)
Parameters
TimeStampA dtstamp component to add, if NULL create a new one with its time set to now.
Returns
TRUE if added.

◆ addIfNew() [1/2]

virtual bool SoftwareAndServices::Library::iCalendar::component::addIfNew ( const property newProperty)
virtual

Add any property to this component, if a component of that same type is not already in this component.

Parameters
newPropertyThe new property to add to this component.
Returns
TRUE if added without error. FALSE if it can not be added for any reason. FALSE is a property of the same name is already in this component.

◆ addIfNew() [2/2]

virtual bool SoftwareAndServices::Library::iCalendar::component::addIfNew ( const component NewComp)
virtual

Add a new component - but only if this component type is not already in this component.

Parameters
NewCompthe new component to add to this component.
Returns
TRUE if added and the first of its kind.

◆ decInstance()

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

Decrement the instance counter for included objects as well as this object.

Returns
The current instance count for this object.

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

◆ getAlarmArray()

time_tVec* SoftwareAndServices::Library::iCalendar::component::getAlarmArray ( const date_time start,
const date_time until 
)

Get all valarm times that will go off from start time until 'until'.

Parameters
startThe start time for the search window.
untilThe end time for the search window.
Returns
An array of time_t values for the alarms. NOTE: The caller MUST delete the results when done.

◆ getComponent() [1/5]

component* SoftwareAndServices::Library::iCalendar::component::getComponent ( const uid uidValue) const

Get the component that has a uid property, with a uidValue.

Parameters
uidValueThe uid to look for.
Returns
The component with a uid property of uidValue, or NULL if none.

◆ getComponent() [2/5]

component* SoftwareAndServices::Library::iCalendar::component::getComponent ( const char *  uidValue) const

Get the component that has a uid property, with a uidValue.

Parameters
uidValueThe uid to look for.
Returns
The component with a uid property of uidValue, or NULL if none.

◆ getComponent() [3/5]

component* SoftwareAndServices::Library::iCalendar::component::getComponent ( unsigned int  offset) const
Parameters
nThWhich component to get (first is zero).
Returns
The nTh component or NULL if none.

◆ getComponent() [4/5]

component* SoftwareAndServices::Library::iCalendar::component::getComponent ( Tokens_t  CompTypeToFind,
unsigned int  nTh 
) const

Get the nTh component of type CompTypeToFind.

Parameters
CompTypeToFindWhat kind of component to look for.
nThWhich CompTypeToFind component (first is zero).

◆ getComponent() [5/5]

component* SoftwareAndServices::Library::iCalendar::component::getComponent ( const char *  xName,
unsigned int  nTh 
) const

Get the nTh non-standard component of type xName.

Parameters
xNameWhat kind of component to look for.
nThWhich CompTypeToFind component (first is zero).

◆ getComponentCount() [1/2]

unsigned int SoftwareAndServices::Library::iCalendar::component::getComponentCount ( ) const
Returns
The number of components in this component.

◆ getComponentCount() [2/2]

unsigned int SoftwareAndServices::Library::iCalendar::component::getComponentCount ( Tokens_t  OfType) const
Returns
The number of components in this component OfType.

◆ getComponentType()

Tokens_t SoftwareAndServices::Library::iCalendar::component::getComponentType ( ) const
Returns
The component type of this component.

◆ getErrorList()

iCalErrorVec* SoftwareAndServices::Library::iCalendar::component::getErrorList ( ) const
Returns
The list of errors for this component.

◆ getInstance()

virtual InstanceCount_t SoftwareAndServices::Library::iCalendar::component::getInstance ( ) const
virtual

Get the instance count for this object.

Returns
The current instance count for this object.

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

◆ getInstanceArray() [1/2]

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

getInstanceArray() Expand the current object into instances.

Parameters
startThe inclusive start DATE-TIME 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::component::getInstanceArray ( iCalendar ical,
const date_time start,
const date_time until = NULL 
) const

getInstanceArray() Expand the current object into instances.

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

◆ getProperty() [1/3]

property* SoftwareAndServices::Library::iCalendar::component::getProperty ( unsigned int  nTh = 0) const

Remove the xx.

Get the nTh property.

Parameters
nThWhich property to get (first is zero).
Returns
The property, or NULL if not found.

◆ getProperty() [2/3]

property* SoftwareAndServices::Library::iCalendar::component::getProperty ( Tokens_t  PropTypeToFind,
unsigned int  nTh 
) const

Get the nTh property of type PropTypeToFind.

Parameters
PropTypeToFindWhat kind of property to find.
nThWhich instance of PropTypeTofind to fetch.
Returns
The property or NULL if none.

◆ getProperty() [3/3]

property* SoftwareAndServices::Library::iCalendar::component::getProperty ( const char *  xName,
unsigned int  nTh 
) const

Get the nTh instance of a non-standard property - by name.

Parameters
xNameThe full name of the property to find.
nThWhich instance of xName to fetch.
Returns
The x-component, or NULL if none.

◆ getPropertyCount() [1/2]

unsigned int SoftwareAndServices::Library::iCalendar::component::getPropertyCount ( ) const

Get the number of properties in this component.

◆ getPropertyCount() [2/2]

unsigned int SoftwareAndServices::Library::iCalendar::component::getPropertyCount ( Tokens_t  PropTypeToCount) const

Get the number of properties in this component, of type 'type'.

Parameters
PropTypeToCountWhat kind of property to count.
Returns
The offset into the propertyList where this property exists. (1st is zero.)

◆ getUserData()

void* SoftwareAndServices::Library::iCalendar::component::getUserData ( ) const

Get any user data stored - or NULL if none.

Returns
Any user data stored by the calling application. Or NULL if none.

◆ getValarm() [1/2]

valarm* SoftwareAndServices::Library::iCalendar::component::getValarm ( int  SequenceToFind) const

Get the valarm in this component that has a sequence property with a value of SequenceToFind.

Parameters
SequenceToFindThe sequence value to search for.
Returns
The valarm or NULL if none.

◆ getValarm() [2/2]

valarm* SoftwareAndServices::Library::iCalendar::component::getValarm ( const sequence SequenceToFind) const

Get the valarm in this component that has a sequence property with a value of SequenceToFind.

Parameters
SequenceToFindThe sequence value to search for.
Returns
The valarm or NULL if none.

◆ getXComponentType()

const char* SoftwareAndServices::Library::iCalendar::component::getXComponentType ( ) const
Returns
The non-standard component name for this component.

◆ incInstance()

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

Increment the instance counter for included objects as well as this object.

Returns
The current instance count for this object.

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

◆ operator delete()

void SoftwareAndServices::Library::iCalendar::component::operator delete ( void *  ToFree)

component - delete operator.

Parameters
ToFreeThe data to free if getInstance() == 0.

◆ operator!=()

virtual bool SoftwareAndServices::Library::iCalendar::component::operator!= ( const component Other) const
virtual

Compare two components for inequality.

Parameters
OtherThe other component to compare to.
Returns
TRUE when they are not equivalent.

◆ operator=()

virtual component& SoftwareAndServices::Library::iCalendar::component::operator= ( const component CopyFrom)
virtual

Copy one component into another.

Parameters
CopyFromThe component to copy from. This does not increment the instance count, this makes a new copy of all contents.
Returns
The updated component.

◆ operator==()

virtual bool SoftwareAndServices::Library::iCalendar::component::operator== ( const component Other) const
virtual

Compare two components for equality.

Parameters
OtherThe other component to compare to.
Returns
TRUE when they are equivalent. NOTE that equivalent does not always mean the same values in the same order.

◆ parse() [1/2]

◆ parse() [2/2]

◆ removeComponent() [1/2]

bool SoftwareAndServices::Library::iCalendar::component::removeComponent ( Tokens_t  CompTypeToRemove,
unsigned int  nTh 
)

Remove the nTh instance of then component type.

Parameters
CompTypeToRemoveWhat kind of component to remove.
nThWhich instance of PropTypeToRemove to remove.
Returns
TRUE if found and removed.

◆ removeComponent() [2/2]

bool SoftwareAndServices::Library::iCalendar::component::removeComponent ( const component ComponentToRemove)
Parameters
ComponentToRemoveA pointer to a component to remove from this component.
Returns
TRUE if found and removed.

◆ removeProperty() [1/2]

bool SoftwareAndServices::Library::iCalendar::component::removeProperty ( Tokens_t  PropTypeToRemove,
unsigned int  nTh 
)

Remove the nTh instance of then property type.

Parameters
PropTypeToRemoveWhat kind of property to remove.
nThWhich instance of PropTypeToRemove to remove.
Returns
TRUE if found and removed.

◆ removeProperty() [2/2]

bool SoftwareAndServices::Library::iCalendar::component::removeProperty ( const property PropertyToRemove)
Parameters
PropertyToRemoveA pointer to a property to remove from this component.
Returns
TRUE if found and removed.

◆ setComponentType() [1/2]

void SoftwareAndServices::Library::iCalendar::component::setComponentType ( Tokens_t  type)
Parameters
typeThe type of component to set this component to.

◆ setComponentType() [2/2]

void SoftwareAndServices::Library::iCalendar::component::setComponentType ( const char *  xType,
unsigned int  len = 0 
)
Parameters
xTypeSet this component type to a non-standard component name.
lenWhen len > 0, then use only the first len characters out of xType in the component name.

◆ setUserData()

void SoftwareAndServices::Library::iCalendar::component::setUserData ( void *  userData)

This method allows the calling application to associate any user data with this component.

Parameters
userDataAny data needed by the calling applications.

◆ sprint()

virtual bool SoftwareAndServices::Library::iCalendar::component::sprint ( String Results) const
virtual
Parameters
ResultsFormat this component to look like an RFC-iCalendar string.
Returns
TRUE when something was appended to Results.

◆ valid()

◆ validComponent()

bool SoftwareAndServices::Library::iCalendar::component::validComponent ( requiredList propList,
bool  xpropAllowed = true,
requiredList compList = NULL,
bool  xcompAllowed = true 
)
protected

Do basic checking on this component.

Parameters
requiredListList of required properties.
xpropAllowedSet to TRUE if it is valid that x-properties might be in this component.
compListList of valid components that might be in this component.
xcompAllowedSet to TRUE if it is valid to have x-components in this component.

Member Data Documentation

◆ componentList

componentVec* SoftwareAndServices::Library::iCalendar::component::componentList

The list of components in this component.

Definition at line 277 of file component.hpp.

◆ propertyList

propertyVec* SoftwareAndServices::Library::iCalendar::component::propertyList

The list of properties in this component.

Definition at line 272 of file component.hpp.


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