Properties Class Reference

#include <properties.h>

Inheritance diagram for Properties:

Map

List of all members.


Detailed Description

A class holding a set of properties.

Definition at line 32 of file properties.h.


Public Member Functions

virtual ~Properties ()
 Destructor.
const std::string & getProperty (const std::string &name, const std::string &def="") const
 Get a map property.
float getFloatProperty (const std::string &name, float def=0.0f) const
 Gets a map property as a float.
bool hasProperty (const std::string &name) const
 Returns whether a certain property is available.
void setProperty (const std::string &name, const std::string &value)
 Set a map property.

Private Types

typedef std::map< std::string,
std::string > 
PropertyMap

Private Attributes

PropertyMap mProperties

Member Typedef Documentation

typedef std::map<std::string, std::string> Properties::PropertyMap [private]

Definition at line 100 of file properties.h.


Constructor & Destructor Documentation

virtual Properties::~Properties (  )  [inline, virtual]

Destructor.

Definition at line 38 of file properties.h.


Member Function Documentation

const std::string& Properties::getProperty ( const std::string &  name,
const std::string &  def = "" 
) const [inline]

Get a map property.

Parameters:
name The name of the property.
def Default value, empty string by default.
Returns:
the value of the given property or the given default when it doesn't exist.

Definition at line 48 of file properties.h.

float Properties::getFloatProperty ( const std::string &  name,
float  def = 0.0f 
) const [inline]

Gets a map property as a float.

Parameters:
name The name of the property.
def Default value, 0.0f by default.
Returns:
the value of the given property, or 0.0f when it doesn't exist.

Definition at line 63 of file properties.h.

bool Properties::hasProperty ( const std::string &  name  )  const [inline]

Returns whether a certain property is available.

Parameters:
name The name of the property.
Returns:
true when a property is defined, false otherwise.

Definition at line 83 of file properties.h.

void Properties::setProperty ( const std::string &  name,
const std::string &  value 
) [inline]

Set a map property.

Parameters:
name The name of the property.
value The value of the property.

Definition at line 94 of file properties.h.


Member Data Documentation

Definition at line 101 of file properties.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5