Spm::Util::PropertyList Class Reference

A property container A property container. Property are identified by a name. There is 3 types recognized (Integer,String,boolean). More...

#include <propertyList.h>

Inheritance diagram for Spm::Util::PropertyList:

Spm::Core::Versionned Spm::Core::Branch Spm::Core::InstalledVersion List of all members.

Public Types

enum  propertyType_e { TYPE_STRING, TYPE_INTEGER, TYPE_BOOLEAN }
typedef std::map< miniXml::ustring,
std::pair< propertyType_e,
boost::any > >::iterator 
iterator
typedef std::map< miniXml::ustring,
std::pair< propertyType_e,
boost::any > >::const_iterator 
const_iterator
typedef std::map< miniXml::ustring,
std::pair< propertyType_e,
boost::any > >::reverse_iterator 
reverse_iterator
typedef std::map< miniXml::ustring,
std::pair< propertyType_e,
boost::any > >::const_reverse_iterator 
const_reverse_iterator

Public Member Functions

 PropertyList ()
void add (const miniXml::ustring &key, boost::any &value)
 Add a property.
void set (const miniXml::ustring &key, boost::any &value)
 Change the value of a property.
void remove (const miniXml::ustring &key)
 Remove a property.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
bool exist (const miniXml::ustring &key) const
 Check if a property exist.
boost::any & get (const miniXml::ustring &key)
const boost::any & get (const miniXml::ustring &key) const
propertyType_egetPropertyType (const miniXml::ustring &key)
const Type_e & getPropertyType (const miniXml::ustring &key) const
miniXml::ustring getString (const miniXml::ustring &key) const
 Helper to get the value of a Property as a string.
int getInteger (const miniXml::ustring &key) const
 Helper to get the value of a Property as an integer.
bool getBoolean (const miniXml::ustring &key) const
 Helper to get the value of a Property as a boolean.
void add (const miniXml::ustring &key, const miniXml::ustring &str)
 Helper to add a new string property.
void add (const miniXml::ustring &key, int i)
 Helper to add a new integer property.
void add (const miniXml::ustring &key, bool boolean)
 Helper to add a new boolean property.
void set (const miniXml::ustring &key, const miniXml::ustring &value)
 Helper to change the value of property to a string.
void set (const miniXml::ustring &key, int value)
 Helper to change the value of property to a integer.
void set (const miniXml::ustring &key, bool value)
 Helper to change the value of property to a boolean.
boost::any & operator[] (const miniXml::ustring &key)
const boost::any & operator[] (const miniXml::ustring &key) const
std::size_t size () const

Protected Attributes

std::map< miniXml::ustring,
std::pair< propertyType_e,
boost::any > > 
properties_

Detailed Description

A property container A property container. Property are identified by a name. There is 3 types recognized (Integer,String,boolean).


Member Typedef Documentation

typedef std::map<miniXml::ustring, std::pair<propertyType_e, boost::any> >::iterator Spm::Util::PropertyList::iterator

Reimplemented in Spm::Core::Branch.

typedef std::map<miniXml::ustring, std::pair<propertyType_e,boost::any> >::const_iterator Spm::Util::PropertyList::const_iterator

Reimplemented in Spm::Core::Branch.

typedef std::map<miniXml::ustring, std::pair<propertyType_e,boost::any> >::reverse_iterator Spm::Util::PropertyList::reverse_iterator

Reimplemented in Spm::Core::Branch.

typedef std::map<miniXml::ustring, std::pair<propertyType_e,boost::any> >::const_reverse_iterator Spm::Util::PropertyList::const_reverse_iterator

Reimplemented in Spm::Core::Branch.


Member Enumeration Documentation

enum Spm::Util::PropertyList::propertyType_e

Enumerator:
TYPE_STRING 
TYPE_INTEGER 
TYPE_BOOLEAN 


Constructor & Destructor Documentation

Spm::Util::PropertyList::PropertyList (  )  [inline]


Member Function Documentation

void Spm::Util::PropertyList::add ( const miniXml::ustring &  key,
boost::any &  value 
)

Add a property.

Parameters:
key The identifier of a property
value The value of the property

void Spm::Util::PropertyList::set ( const miniXml::ustring &  key,
boost::any &  value 
)

Change the value of a property.

Parameters:
key The identifier of a property
value The value of the property

void Spm::Util::PropertyList::remove ( const miniXml::ustring &  key  ) 

Remove a property.

Parameters:
key The identifier of a property

Reimplemented in Spm::Core::Branch.

iterator Spm::Util::PropertyList::begin (  )  [inline]

Returns:
an iterator to the first property

Reimplemented in Spm::Core::Branch.

iterator Spm::Util::PropertyList::end (  )  [inline]

Reimplemented in Spm::Core::Branch.

const_iterator Spm::Util::PropertyList::begin (  )  const [inline]

Reimplemented in Spm::Core::Branch.

const_iterator Spm::Util::PropertyList::end (  )  const [inline]

Reimplemented in Spm::Core::Branch.

reverse_iterator Spm::Util::PropertyList::rbegin (  )  [inline]

Reimplemented in Spm::Core::Branch.

reverse_iterator Spm::Util::PropertyList::rend (  )  [inline]

Reimplemented in Spm::Core::Branch.

const_reverse_iterator Spm::Util::PropertyList::rbegin (  )  const [inline]

Reimplemented in Spm::Core::Branch.

const_reverse_iterator Spm::Util::PropertyList::rend (  )  const [inline]

Reimplemented in Spm::Core::Branch.

bool Spm::Util::PropertyList::exist ( const miniXml::ustring &  key  )  const

Check if a property exist.

Parameters:
key The identifier to check
Returns:
true if the property exits, false otherwise

boost::any& Spm::Util::PropertyList::get ( const miniXml::ustring &  key  ) 

Parameters:
key The identifier of the property
Returns:
the value of the property

const boost::any& Spm::Util::PropertyList::get ( const miniXml::ustring &  key  )  const

Parameters:
key The identifier of the property
Returns:
the value of the property

propertyType_e& Spm::Util::PropertyList::getPropertyType ( const miniXml::ustring &  key  ) 

Parameters:
key The identifier of the property
Returns:
the type of the property

const Type_e& Spm::Util::PropertyList::getPropertyType ( const miniXml::ustring &  key  )  const

Parameters:
key The identifier of the property
Returns:
the type of the property

miniXml::ustring Spm::Util::PropertyList::getString ( const miniXml::ustring &  key  )  const

Helper to get the value of a Property as a string.

Parameters:
key The identifier of the property
Returns:
the value of the property as a string

int Spm::Util::PropertyList::getInteger ( const miniXml::ustring &  key  )  const

Helper to get the value of a Property as an integer.

Parameters:
key The identifier of the property
Returns:
the value of the property as an integer

bool Spm::Util::PropertyList::getBoolean ( const miniXml::ustring &  key  )  const

Helper to get the value of a Property as a boolean.

Parameters:
key The identifier of the property
Returns:
the value of the property as a boolean

void Spm::Util::PropertyList::add ( const miniXml::ustring &  key,
const miniXml::ustring &  str 
) [inline]

Helper to add a new string property.

Parameters:
key The identifier of the new property
str The value of the new property

void Spm::Util::PropertyList::add ( const miniXml::ustring &  key,
int  i 
) [inline]

Helper to add a new integer property.

Parameters:
i The identifier of the new property
str The value of the new property

void Spm::Util::PropertyList::add ( const miniXml::ustring &  key,
bool  boolean 
) [inline]

Helper to add a new boolean property.

Parameters:
key The identifier of the new property
boolean The value of the new property

void Spm::Util::PropertyList::set ( const miniXml::ustring &  key,
const miniXml::ustring &  value 
) [inline]

Helper to change the value of property to a string.

Parameters:
key The identifier of the new property
value The value of the new property

void Spm::Util::PropertyList::set ( const miniXml::ustring &  key,
int  value 
) [inline]

Helper to change the value of property to a integer.

Parameters:
key The identifier of the new property
value The value of the new property

void Spm::Util::PropertyList::set ( const miniXml::ustring &  key,
bool  value 
) [inline]

Helper to change the value of property to a boolean.

Parameters:
key The identifier of the new property
value The value of the new property

boost::any& Spm::Util::PropertyList::operator[] ( const miniXml::ustring &  key  )  [inline]

const boost::any& Spm::Util::PropertyList::operator[] ( const miniXml::ustring &  key  )  const [inline]

std::size_t Spm::Util::PropertyList::size (  )  const [inline]

Returns:
the size of the PropertyList


Member Data Documentation

std::map<miniXml::ustring, std::pair<propertyType_e, boost::any> > Spm::Util::PropertyList::properties_ [protected]


The documentation for this class was generated from the following file:
Generated on Sat Mar 21 17:00:15 2009 for libSpm by  doxygen 1.5.2