gxProperties Class Reference

Encapsulates a collection of properties - key/value pairs. More...

#include <gxProperties.h>

List of all members.

Public Types

typedef std::list< std::string > keys_t

Public Member Functions

 gxProperties ()
virtual ~gxProperties ()
void clear ()
 Clears this collection of properties so that it has no keys/values.
bool containsKey (const char *key)
 Tests whether this collection contains a property with the specified key.
std::string get (const char *key, const char *defaultValue="")
 Get the specified property.
std::string get (const std::string &key, const char *defaultValue="")
 Convenience overload of "get" when building keys from STD strings.
keys_t keys ()
 Return a list of all keys in the collection.
void put (const char *key, const char *value)
 Puts the specified property into the collection at the specified key.
void put (const char *key, long value)
 Puts the specified integer property into the collection at the specified key.
void put (const std::string &key, const char *value)
 Convenience overload of "put" when building keys from STD strings.
void put (const std::string &key, long value)
 Convenience overload of "put" when building keys from STD strings.
int size ()
 Return the size of the collection (number of keys).


Detailed Description

Encapsulates a collection of properties - key/value pairs.

This class is loosely inspired by java.util.Properties, but has fewer features.

The initial motivation for this class was to store properties about audio cards - buffer size, sample rate etc. and to simplify the process of converting this information to/from XML.


Member Typedef Documentation

typedef std::list<std::string> gxProperties::keys_t
 


Constructor & Destructor Documentation

gxProperties::gxProperties  ) 
 

virtual gxProperties::~gxProperties  )  [virtual]
 


Member Function Documentation

void gxProperties::clear  ) 
 

Clears this collection of properties so that it has no keys/values.

bool gxProperties::containsKey const char *  key  ) 
 

Tests whether this collection contains a property with the specified key.

std::string gxProperties::get const std::string &  key,
const char *  defaultValue = ""
 

Convenience overload of "get" when building keys from STD strings.

std::string gxProperties::get const char *  key,
const char *  defaultValue = ""
 

Get the specified property.

keys_t gxProperties::keys  ) 
 

Return a list of all keys in the collection.

void gxProperties::put const std::string &  key,
long  value
 

Convenience overload of "put" when building keys from STD strings.

void gxProperties::put const std::string &  key,
const char *  value
 

Convenience overload of "put" when building keys from STD strings.

void gxProperties::put const char *  key,
long  value
 

Puts the specified integer property into the collection at the specified key.

void gxProperties::put const char *  key,
const char *  value
 

Puts the specified property into the collection at the specified key.

int gxProperties::size  ) 
 

Return the size of the collection (number of keys).


The documentation for this class was generated from the following file:
Generated on Mon Nov 21 01:01:37 2005 for gxLib by  doxygen 1.4.5