cms::CMSProperties Class Reference

#include <src/main/cms/CMSProperties.h>


Detailed Description

Interface for a Java-like properties object.

This is essentially a map of key-value string pairs.

Public Member Functions

virtual ~CMSProperties ()
virtual bool isEmpty () const =0
 Returns true if the properties object is empty.
virtual const char * getProperty (const std::string &name) const =0
 Looks up the value for the given property.
virtual std::string getProperty (const std::string &name, const std::string &defaultValue) const =0
 Looks up the value for the given property.
virtual void setProperty (const std::string &name, const std::string &value)=0
 Sets the value for a given property.
virtual bool hasProperty (const std::string &name) const =0
 Check to see if the Property exists in the set.
virtual void remove (const std::string &name)=0
 Removes the property with the given name.
virtual std::vector
< std::pair
< std::string,
std::string > > 
toArray () const =0
 Method that serializes the contents of the property map to an arryay.
virtual void copy (const CMSProperties *source)=0
 Copies the contents of the given properties object to this one.
virtual CMSPropertiesclone () const =0
 Clones this object.
virtual void clear ()=0
 Clears all properties from the map.
virtual std::string toString () const =0
 Formats the contents of the Properties Object into a string that can be logged, etc.


Constructor & Destructor Documentation

virtual cms::CMSProperties::~CMSProperties (  )  [inline, virtual]


Member Function Documentation

virtual bool cms::CMSProperties::isEmpty (  )  const [pure virtual]

Returns true if the properties object is empty.

Returns:
true if empty

virtual const char* cms::CMSProperties::getProperty ( const std::string &  name  )  const [pure virtual]

Looks up the value for the given property.

Parameters:
name The name of the property to be looked up.
Returns:
the value of the property with the given name, if it exists. If it does not exist, returns NULL.

virtual std::string cms::CMSProperties::getProperty ( const std::string &  name,
const std::string &  defaultValue 
) const [pure virtual]

Looks up the value for the given property.

Parameters:
name the name of the property to be looked up.
defaultValue The value to be returned if the given property does not exist.
Returns:
The value of the property specified by name, if it exists, otherwise the defaultValue.

virtual void cms::CMSProperties::setProperty ( const std::string &  name,
const std::string &  value 
) [pure virtual]

Sets the value for a given property.

If the property already exists, overwrites the value.

Parameters:
name The name of the value to be written.
value The value to be written.

virtual bool cms::CMSProperties::hasProperty ( const std::string &  name  )  const [pure virtual]

Check to see if the Property exists in the set.

Parameters:
name the name of the property to check
Returns:
true if property exists, false otherwise.

virtual void cms::CMSProperties::remove ( const std::string &  name  )  [pure virtual]

Removes the property with the given name.

Parameters:
name the name of the property to be removed.s

virtual std::vector< std::pair< std::string, std::string > > cms::CMSProperties::toArray (  )  const [pure virtual]

Method that serializes the contents of the property map to an arryay.

Returns:
list of pairs where the first is the name and the second is the value.

virtual void cms::CMSProperties::copy ( const CMSProperties source  )  [pure virtual]

Copies the contents of the given properties object to this one.

Parameters:
source The source properties object.

virtual CMSProperties* cms::CMSProperties::clone (  )  const [pure virtual]

Clones this object.

Returns:
a replica of this object.

virtual void cms::CMSProperties::clear (  )  [pure virtual]

Clears all properties from the map.

virtual std::string cms::CMSProperties::toString (  )  const [pure virtual]

Formats the contents of the Properties Object into a string that can be logged, etc.

Returns:
string value of this object.


The documentation for this class was generated from the following file:
Generated on Sat Oct 27 16:56:59 2007 for cms-1.2 by  doxygen 1.5.3