VMime
propertySet Class Reference
Inheritance diagram for propertySet:
Collaboration diagram for propertySet:

Classes

class  constPropertyProxy
 
class  property
 
class  propertyProxy
 

Public Member Functions

 propertySet ()
 
 propertySet (const string &props)
 
 propertySet (const propertySet &set)
 
 ~propertySet ()
 
propertySetoperator= (const propertySet &set)
 
void setFromString (const string &props)
 
void removeAllProperties ()
 
void removeProperty (const string &name)
 
bool hasProperty (const string &name) const
 
template<class TYPE >
const TYPE getProperty (const string &name) const
 
template<class TYPE >
const TYPE getProperty (const string &name, const TYPE defaultValue) const
 
template<class TYPE >
void setProperty (const string &name, const TYPE &value)
 
propertyProxy operator[] (const string &name)
 
const constPropertyProxy operator[] (const string &name) const
 
const std::vector< shared_ptr
< const property > > 
getPropertyList () const
 
const std::vector< shared_ptr
< property > > 
getPropertyList ()
 
template<>
string valueFromString (const string &value)
 
template<>
string valueToString (const string &value)
 
template<>
bool valueFromString (const string &value)
 
template<>
string valueToString (const bool &value)
 
template<>
VMIME_EXPORT string valueFromString (const string &value)
 
template<>
VMIME_EXPORT string valueToString (const string &value)
 
template<>
VMIME_EXPORT bool valueFromString (const string &value)
 
template<>
VMIME_EXPORT string valueToString (const bool &value)
 

Static Public Member Functions

template<typename TYPE >
static TYPE valueFromString (const string &value)
 
template<typename TYPE >
static string valueToString (const TYPE &value)
 

Additional Inherited Members

- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

Manage a list of (name,value) pairs.

Constructor & Destructor Documentation

propertySet ( const string props)
propertySet ( const propertySet set)

Member Function Documentation

const TYPE getProperty ( const string name) const

Get the value of the specified property.

Exceptions
exceptions::no_such_propertyif the property does not exist
Parameters
nameproperty name
Returns
value of the specified property

Referenced by qpEncoder::decode(), uuEncoder::encode(), b64Encoder::encode(), qpEncoder::encode(), b64Encoder::getEncodedSize(), and qpEncoder::getEncodedSize().

const TYPE getProperty ( const string name,
const TYPE  defaultValue 
) const

Get the value of the specified property.

A default value can be returned if the property is not set.

Parameters
nameproperty name
defaultValuevalue to return if the specified property does not exist
Returns
value of the specified property or default value if if does not exist
const std::vector< shared_ptr< const propertySet::property > > getPropertyList ( ) const

Return the property list.

Returns
list of properties
const std::vector< shared_ptr< propertySet::property > > getPropertyList ( )

Return the property list.

Returns
list of properties
bool hasProperty ( const string name) const

Test whether the specified property is set.

Parameters
namename of the property to test
Returns
true if the property is set (has a value), false otherwise

Referenced by defaultAuthenticator::getPassword(), and defaultAuthenticator::getUsername().

propertySet & operator= ( const propertySet set)
propertySet::propertyProxy operator[] ( const string name)

Return a proxy object to access the specified property suitable for reading or writing.

If the property does not exist and the value is changed, a new property will be created.

Parameters
nameproperty name
Returns
proxy object for the specified property
const propertySet::constPropertyProxy operator[] ( const string name) const

Return a proxy object to access the specified property suitable for reading only.

Exceptions
exceptions::no_such_propertyif the property does not exist
Returns
read-only proxy object for the specified property
void removeAllProperties ( )

Remove all properties from the list.

Referenced by propertySet::operator=(), and propertySet::~propertySet().

void removeProperty ( const string name)

Remove the specified property.

Parameters
namename of the property to remove
void setFromString ( const string props)

Parse a string and extract one or more properties.

The string format is: name[=value](;name[=value])*.

Parameters
propsstring representing a list of properties
void setProperty ( const string name,
const TYPE &  value 
)

Change the value of the specified property or create a new property set to the specified a value.

Parameters
nameproperty name
valueproperty value
string valueFromString ( const string value)
bool valueFromString ( const string value)
static TYPE valueFromString ( const string value)
static
VMIME_EXPORT string valueFromString ( const string value)
VMIME_EXPORT bool valueFromString ( const string value)
string valueToString ( const string value)
string valueToString ( const bool &  value)
static string valueToString ( const TYPE &  value)
static
VMIME_EXPORT string valueToString ( const string value)
VMIME_EXPORT string valueToString ( const bool &  value)

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