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

This supports any CAL-ADDRESS that is supported by calendaring. More...

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

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

Public Types

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  Uri_t {
  Other_t, Cap_t, Cid_t, File_t,
  Ftp_t, Gopher_t, Http_t, Https_t,
  Ldap_t, MailTo_t, Mid_t, News_t,
  Nntp_t, Prosperp_t, Telnet_t, Wais_t,
  WebCal_t, WebDav_t, CalDav_t, Sql_t,
  LotusCal_t, MicrosoftCal_t, OracleCal_t, Sip_t,
  Sips_t, URI_LAST
}
 The currently known URI types. More...
 

Public Member Functions

 cal_address (const Uri *uriValue)
 Constructor - Uri. More...
 
 cal_address (const uri *uriValue=NULL)
 Constructor - uri. More...
 
 cal_address (const text *tValue)
 Constructor - text. More...
 
 cal_address (const char *cValue)
 Constructor - (const char*) More...
 
virtual ~cal_address ()
 Destructor. More...
 
void AddHeader (const char *TheName, const char *TheValue)
 Add a new header to the URI. More...
 
void AddParameter (const char *TheName, const char *TheValue)
 Add a new parameter to the URI. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance. More...
 
const valuegetData () const
 Get the pointer to the data being stored. More...
 
const HeaderGetHeader (unsigned long nTh) const
 Get the nTh Header and value object. More...
 
const HeaderGetHeader (const char *TheName) const
 Get the Header with the name TheName. More...
 
virtual InstanceCount_t getInstance () const
 
virtual InstanceCount_t getInstance () const
 
const ParameterGetParameter (unsigned long nTh) const
 Get the nTh Parameter and value object. More...
 
const ParameterGetParameter (const char *TheName) const
 Get the Parameter with the name TheName. More...
 
const char * GetPassword () const
 
short GetPort () const
 
const char * GetScheme () const
 
const char * GetSchemeSpecific () const
 
Uri_t GetSchemeType () const
 
const char * GetServer () const
 
Tokens_t getType () const
 Get the type of data being stored. More...
 
const char * GetUri () const
 
const char * GetUser () const
 
const char * getXValueType () const
 Get the type of data being stored. More...
 
size_t HeaderCount () const
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
bool IsUri (const char *IsSuppotedUri) const
 
void operator delete (void *)
 For most of the value types, the base class delete operator will keep the instance count correct. More...
 
bool operator!= (const Uri *Other) const
 Uri != compare operator. More...
 
bool operator!= (const Uri &Other) const
 Uri != compare operator. More...
 
bool operator!= (const char *Other) const
 Uri != compare operator. More...
 
bool operator== (const Uri *Other) const
 Uri == compare operator. More...
 
bool operator== (const Uri &Other) const
 Uri == compare operator. More...
 
bool operator== (const char *Other) const
 Uri == compare operator. More...
 
size_t ParameterCount () const
 
virtual bool parse (SoftwareAndServices::Library::Common::Parse &in, component *errors)
 Parse a cal_address. More...
 
virtual bool parse (const char *in, component *errors)
 Parse a cal_address. More...
 
bool Parse (const char *aString)
 Parse a string into a Uri. More...
 
void setData (void *DataPtr)
 Set the data to the data being stored. More...
 
void SetPassword (const char *pw)
 Set the password part of the schema. More...
 
void SetPort (const int port)
 Set the port number to use. More...
 
void SetScheme (const char *type)
 Manually set the scheme (example http, ftp, file, ...). More...
 
void SetSchemeSpecific (const char *value)
 Set the schema specific part of the Uri. More...
 
void SetSchemeType (const Uri_t type, const char *otherType=NULL)
 Set the schema type. More...
 
void SetServer (const char *server)
 Set the server name of the Uri. More...
 
void setType (Tokens_t Token)
 Set the type of data being stored. More...
 
void SetUser (const char *user)
 Set the username part of the schema. 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...
 
virtual bool Sprint (string *Results) const
 Convert the contents of this Uri to a std::string. More...
 
virtual bool Sprint (String &Results) const
 Convert the contents of this Uri to a std::string. More...
 
bool Sprint (char *resultString, const size_t resultStringMaxSize) const
 Store the Uri into the named string. 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...
 

Static Public Attributes

static const char ** tokenStrings
 A list of strings for the names of tokens. More...
 
static const char * URICalDav_s
 
static const char * URICap_s
 
static const char * URICid_s
 
static const char * URIFile_s
 
static const char * URIFtp_s
 
static const char * URIGopher_s
 
static const char * URIHttp_s
 
static const char * URIHttps_s
 
static const char * URILdap_s
 
static const char * URILotusCal_s
 
static const char * URIMailTo_s
 
static const char * URIMicrosoftCal_s
 
static const char * URIMid_s
 
static const char * URINews_s
 
static const char * URINntp_s
 
static const char * URIOracleCal_s
 
static const char * URIProsperp_s
 
static const char * URISip_s
 
static const char * URISips_s
 
static const char * URISql_s
 
static const char * URITelnet_s
 
static const char * UriTokenTable [40]
 A list of strings representing schemas. More...
 
static const char * URIWais_s
 
static const char * URIWebCal_s
 
static const char * URIWebDav_s
 

Detailed Description

This supports any CAL-ADDRESS that is supported by calendaring.

Definition at line 82 of file cal_address.hpp.

Member Enumeration Documentation

◆ quote_errors

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

Definition at line 204 of file BaseValueType.hpp.

◆ Uri_t

The currently known URI types.

Enumerator
Cap_t 

Calendar Access Protocol.

Cid_t 

Content ID (Used to identify an attachment in a MIME message)

File_t 

FILE uri (direct file I/O - no network needed)

Ftp_t 

FTP uri (File Transfer Protocol)

Gopher_t 

Gopher uri - no long used on the internet?

Http_t 

HTTP uri (HyperText Transfer Protocol)

Https_t 

HTTPS uri (HyperText Transfer Protocol - Secure)

Ldap_t 

LDAP uri (Directory Services)

MailTo_t 

EMail uri (Represents an EMAIL address)

Mid_t 

Message ID uri (Used in MIME message and some IMAP and POP server to identify a unique message)

News_t 

Old news protocol.

Nntp_t 

Net News (Net News Transfer Protocol)

Prosperp_t 

?? Old

Telnet_t 

Telnet.

Wais_t 

?? Old

WebCal_t 

Web Based Calendars (not WebDav)

WebDav_t 

Web + DAV.

CalDav_t 

Web + DAV + Calendar.

Sql_t 

An SQL based Calendar - for calendars - Unique to Project-Contracting.com.

LotusCal_t 

Lotus URI - for calendars - Unique to Project-Contracting.com.

MicrosoftCal_t 

Microsoft URI - for calendars - Unique to Project-Contracting.com.

OracleCal_t 

Oracle URI - for calendars - Unique to Project-Contracting.com.

Sip_t 

SIP URI - for Session initiation protocol.

Sips_t 

SIPs URI - for secure (TLS) Session initiation protocol.

Definition at line 205 of file Uri.hpp.

Constructor & Destructor Documentation

◆ cal_address() [1/4]

SoftwareAndServices::Library::iCalendar::cal_address::cal_address ( const Uri uriValue)

Constructor - Uri.

Parameters
uriValueThe initial uri.

◆ cal_address() [2/4]

SoftwareAndServices::Library::iCalendar::cal_address::cal_address ( const uri uriValue = NULL)

Constructor - uri.

Parameters
uriValueThe initial uri.

◆ cal_address() [3/4]

SoftwareAndServices::Library::iCalendar::cal_address::cal_address ( const text tValue)

Constructor - text.

Parameters
tValueThe initial uri.

◆ cal_address() [4/4]

SoftwareAndServices::Library::iCalendar::cal_address::cal_address ( const char *  cValue)

Constructor - (const char*)

Parameters
cValueThe initial uri

◆ ~cal_address()

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

Destructor.

Member Function Documentation

◆ AddHeader()

void SoftwareAndServices::Library::RfcBasic::Uri::AddHeader ( const char *  TheName,
const char *  TheValue 
)
inherited

Add a new header to the URI.

Parameters
TheNameThe name of the Header to add.
TheValueTheValue The value of the Header to add.

◆ AddParameter()

void SoftwareAndServices::Library::RfcBasic::Uri::AddParameter ( const char *  TheName,
const char *  TheValue 
)
inherited

Add a new parameter to the URI.

Parameters
TheNameThe name of the Parameter to add.
TheValueTheValue The value of the Parameter to add.

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

◆ decInstance() [1/2]

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.

◆ decInstance() [2/2]

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

Decrement the instance.

Returns
The instance count, after decrementing it.

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.

◆ GetHeader() [1/2]

const Header* SoftwareAndServices::Library::RfcBasic::Uri::GetHeader ( unsigned long  nTh) const
inherited

Get the nTh Header and value object.

Returns
The nTh Header object (first is zero), or NULL if it does not exist..

◆ GetHeader() [2/2]

const Header* SoftwareAndServices::Library::RfcBasic::Uri::GetHeader ( const char *  TheName) const
inherited

Get the Header with the name TheName.

Parameters
TheNamethe name of the Header to find.
Returns
The Header with the name TheName, or NULL if it does not exist.

◆ getInstance() [1/2]

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< Uri >::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.

◆ GetParameter() [1/2]

const Parameter* SoftwareAndServices::Library::RfcBasic::Uri::GetParameter ( unsigned long  nTh) const
inherited

Get the nTh Parameter and value object.

Returns
The nTh Parameter object (first is zero), or NULL if it does not exist..

◆ GetParameter() [2/2]

const Parameter* SoftwareAndServices::Library::RfcBasic::Uri::GetParameter ( const char *  TheName) const
inherited

Get the Parameter with the name TheName.

Parameters
TheNamethe name of the parameter to find.
Returns
The Parameter with the name TheName, or NULL if it does not exist.

◆ GetPassword()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetPassword ( ) const
inherited
Returns
The password associated with the Uri, or NULL if none.

◆ GetPort()

short SoftwareAndServices::Library::RfcBasic::Uri::GetPort ( ) const
inherited
Returns
The port number for the schema. If not specified, a zero will be returned.

For known Uri_t types, a zero returned means use the default port.

◆ GetScheme()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetScheme ( ) const
inherited
Returns
The schema as a string.

◆ GetSchemeSpecific()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetSchemeSpecific ( ) const
inherited
Returns
Get the schema specific part of the Uri.

◆ GetSchemeType()

Uri_t SoftwareAndServices::Library::RfcBasic::Uri::GetSchemeType ( ) const
inherited
Returns
The schema type as Uri_t.

◆ GetServer()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetServer ( ) const
inherited
Returns
The server name from the Uri.

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

◆ GetUri()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetUri ( ) const
inherited
Returns
The Uri as a string.

◆ GetUser()

const char* SoftwareAndServices::Library::RfcBasic::Uri::GetUser ( ) const
inherited
Returns
The username associated with the Uri, or NULL if none.

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

◆ HeaderCount()

size_t SoftwareAndServices::Library::RfcBasic::Uri::HeaderCount ( ) const
inherited
Returns
Then number of Header objects.

◆ incInstance() [1/2]

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

Increment the instance.

Returns
The instance value, after incrementing it.

Definition at line 109 of file instance.hpp.

◆ incInstance() [2/2]

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.

◆ IsUri()

bool SoftwareAndServices::Library::RfcBasic::Uri::IsUri ( const char *  IsSuppotedUri) const
inherited
Parameters
IsSuppotedUriA string with an URI value.
Returns
TRUE when IsSuppotedUri is a known and supported URI value.

◆ operator delete()

void SoftwareAndServices::Library::iCalendar::uri::operator delete ( void *  )
inherited

For most of the value types, the base class delete operator will keep the instance count correct.

However this class is derived from two base classes each of which has an instance counter. So this member function calls both.

◆ operator!=() [1/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator!= ( const Uri Other) const
inherited

Uri != compare operator.

Parameters
OtherA pointer to Other Uri to compare to.
Returns
TRUE when they are NOT equal in value.

◆ operator!=() [2/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator!= ( const Uri Other) const
inherited

Uri != compare operator.

Parameters
OtherA ref to Other Uri to compare to.
Returns
TRUE when they are NOT equal in value.

◆ operator!=() [3/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator!= ( const char *  Other) const
inherited

Uri != compare operator.

Parameters
OtherA pointer to Other Uri to compare to.
Returns
TRUE when they are NOT equal in value.

◆ operator==() [1/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator== ( const Uri Other) const
inherited

Uri == compare operator.

Parameters
OtherA pointer to Other Uri to compare to.
Returns
TRUE when they are equal in value.

◆ operator==() [2/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator== ( const Uri Other) const
inherited

Uri == compare operator.

Parameters
OtherA ref to Other Uri to compare to.
Returns
TRUE when they are equal in value.

◆ operator==() [3/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::operator== ( const char *  Other) const
inherited

Uri == compare operator.

Parameters
OtherA pointer to Other Uri to compare to.
Returns
TRUE when they are equal in value.

◆ ParameterCount()

size_t SoftwareAndServices::Library::RfcBasic::Uri::ParameterCount ( ) const
inherited
Returns
Then number of Parameter objects.

◆ parse() [1/2]

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

Parse a cal_address.

Parameters
inAn initialized Parse object.
errorsIf not NULL and there are parsing problems, the problems will be reported in errors.
Returns
TRUE if successful.

Reimplemented from SoftwareAndServices::Library::iCalendar::uri.

◆ parse() [2/2]

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

Parse a cal_address.

Parameters
inAn initialized Parse object.
errorsIf not NULL and there are parsing problems, the problems will be reported in errors.
Returns
TRUE if successful.

Reimplemented from SoftwareAndServices::Library::iCalendar::uri.

◆ Parse()

bool SoftwareAndServices::Library::RfcBasic::Uri::Parse ( const char *  aString)
inherited

Parse a string into a Uri.

Parameters
aStringThe string to parse into a Uri.
Returns
TRUE if it was parsed without errors.

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

◆ SetPassword()

void SoftwareAndServices::Library::RfcBasic::Uri::SetPassword ( const char *  pw)
inherited

Set the password part of the schema.

Parameters
pwThe password of the schema value.

◆ SetPort()

void SoftwareAndServices::Library::RfcBasic::Uri::SetPort ( const int  port)
inherited

Set the port number to use.

Parameters
portThe port number to use, zero means use the default for the schema.

◆ SetScheme()

void SoftwareAndServices::Library::RfcBasic::Uri::SetScheme ( const char *  type)
inherited

Manually set the scheme (example http, ftp, file, ...).

Parameters
typeA manually set scheme, will be internally converted to a Uri_t if possible.

◆ SetSchemeSpecific()

void SoftwareAndServices::Library::RfcBasic::Uri::SetSchemeSpecific ( const char *  value)
inherited

Set the schema specific part of the Uri.

Parameters
valueThe schema specific type value.

◆ SetSchemeType()

void SoftwareAndServices::Library::RfcBasic::Uri::SetSchemeType ( const Uri_t  type,
const char *  otherType = NULL 
)
inherited

Set the schema type.

Parameters
typeAn enumerated Uri_t. Ignored if otherType is supplied.
otherTypeOnly supply when not specified in Uri_t.

◆ SetServer()

void SoftwareAndServices::Library::RfcBasic::Uri::SetServer ( const char *  server)
inherited

Set the server name of the Uri.

Parameters
serverThe server as a hostname or IP address.

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

◆ SetUser()

void SoftwareAndServices::Library::RfcBasic::Uri::SetUser ( const char *  user)
inherited

Set the username part of the schema.

Parameters
userThe username of the schema value.

◆ 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::cal_address::sprint ( String Results) const
virtual

Print the object in RFC-iCalendar format.

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

Reimplemented from SoftwareAndServices::Library::iCalendar::uri.

◆ Sprint() [1/3]

virtual bool SoftwareAndServices::Library::RfcBasic::Uri::Sprint ( string *  Results) const
virtualinherited

Convert the contents of this Uri to a std::string.

Parameters
ResultsA std::string representing the Uri.
Returns
TRUE when something appended to Results.

◆ Sprint() [2/3]

virtual bool SoftwareAndServices::Library::RfcBasic::Uri::Sprint ( String Results) const
virtualinherited

Convert the contents of this Uri to a std::string.

Parameters
ResultsA std::string representing the Uri.
Returns
TRUE when something appended to Results.

◆ Sprint() [3/3]

bool SoftwareAndServices::Library::RfcBasic::Uri::Sprint ( char *  resultString,
const size_t  resultStringMaxSize 
) const
inherited

Store the Uri into the named string.

Parameters
resultStringWhere to put the results.
resultStringMaxSizePut no more (including the terminating NIL bite into resultString.
Returns
TRUE when everything worked and fit.

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

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.

◆ UriTokenTable

const char* SoftwareAndServices::Library::RfcBasic::Uri::UriTokenTable[40]
staticinherited

A list of strings representing schemas.

Definition at line 583 of file Uri.hpp.


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