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

A basic implementation an a generic URI. More...

#include </home/doug/src/SoftwareAndServices/libSaSRfcBasic/Uri.hpp>

+ Inheritance diagram for SoftwareAndServices::Library::RfcBasic::Uri:
+ Collaboration diagram for SoftwareAndServices::Library::RfcBasic::Uri:

Classes

class  Header
 Each one holds one header Value. More...
 
class  NameValuePair
 Each one holds one name and value. More...
 
class  Parameter
 Each one holds one Parameter value. More...
 

Public Types

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

 Uri ()
 Uri Constructor. More...
 
virtual ~Uri ()
 Uri 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...
 
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
 
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
 
const char * GetUri () const
 
const char * GetUser () const
 
size_t HeaderCount () const
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
bool IsUri (const char *IsSuppotedUri) const
 
void operator delete (void *ToFree)
 
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
 
bool Parse (const char *aString)
 Parse a string into a Uri. 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 SetUser (const char *user)
 Set the username part of the schema. 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 Attributes

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

A basic implementation an a generic URI.

sip:user:password@host:port;uri-parameters?headers

Definition at line 81 of file Uri.hpp.

Member Enumeration Documentation

◆ 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

◆ Uri()

SoftwareAndServices::Library::RfcBasic::Uri::Uri ( )

Uri Constructor.

◆ ~Uri()

virtual SoftwareAndServices::Library::RfcBasic::Uri::~Uri ( )
virtual

Uri Destructor.

Member Function Documentation

◆ AddHeader()

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

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 
)

Add a new parameter to the URI.

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

◆ decInstance()

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.

◆ GetHeader() [1/2]

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

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

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

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

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

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
Returns
The password associated with the Uri, or NULL if none.

◆ GetPort()

short SoftwareAndServices::Library::RfcBasic::Uri::GetPort ( ) const
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
Returns
The schema as a string.

◆ GetSchemeSpecific()

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

◆ GetSchemeType()

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

◆ GetServer()

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

◆ GetUri()

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

◆ GetUser()

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

◆ HeaderCount()

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

◆ incInstance()

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.

◆ IsUri()

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

◆ operator!=() [1/3]

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

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

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

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

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

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

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
Returns
Then number of Parameter objects.

◆ Parse()

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

Parse a string into a Uri.

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

◆ SetPassword()

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

Set the password part of the schema.

Parameters
pwThe password of the schema value.

◆ SetPort()

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

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)

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)

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 
)

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)

Set the server name of the Uri.

Parameters
serverThe server as a hostname or IP address.

◆ SetUser()

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

Set the username part of the schema.

Parameters
userThe username of the schema value.

◆ Sprint() [1/3]

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

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
virtual

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

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.

Member Data Documentation

◆ UriTokenTable

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

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: