Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

PropsFile Class Reference

#include <PropsFile.h>

List of all members.


Detailed Description

This class provides a read-only view of an XML-based properties file.

The file is expected to have one element for every property. Each element has an element name (as per normal XML) which gives the property's name, and two attributes: "type", and "value".

No two elements in a given properties file may have the same name.

"type" must be one of the following values: bool int uint long ulong ulonglong double string

"value" must be parsable according to the specified "type".

For example:

<foo type=int value=3 /> <bar type=string value="antelope and deer" /> <baz type=string value=porcshe />

NOTES: The file's content is read only during the construction of this PropsFile object. Changs to the underlying file won't be apparent until a new PropsFile object is created.

CONCURRENCY: Concurrent invocations may be rampant.


Public Member Functions

 PropsFile (string filepath) throw (AuroraException)
 PropsFile (string filepath, string prefix, int argc, const char *argv[]) throw (AuroraException)
virtual ~PropsFile ()
map< string, string > findPropsByPrefix (string prefix) const throw (AuroraException)
bool getBool (string propName) const throw (AuroraException)
bool isBoolPropDefined (string propName) const throw (AuroraException)
bool getBoolWithDefault (string propName, bool defaultValue) const
int getInt (string propName) const throw (AuroraException)
bool isIntPropDefined (string propName) const throw (AuroraException)
int getIntWithDefault (string propName, int defaultValue) const
unsigned int getUInt (string propName) const throw (AuroraException)
bool isUIntPropDefined (string propName) const throw (AuroraException)
unsigned int getUIntWithDefault (string propName, unsigned int defaultValue) const
long getLong (string propName) const throw (AuroraException)
bool isLongPropDefined (string propName) const throw (AuroraException)
long getLongWithDefault (string propName, long defaultValue) const
unsigned long getULong (string propName) const throw (AuroraException)
bool isULongPropDefined (string propName) const throw (AuroraException)
unsigned long getULongWithDefault (string propName, unsigned long defaultValue) const
unsigned long long getULongLong (string propName) const throw (AuroraException)
bool isULongLongPropDefined (string propName) const throw (AuroraException)
unsigned long long getULongLongWithDefault (string propName, unsigned long long defaultValue) const
double getDouble (string propName) const throw (AuroraException)
bool isDoubleDefined (string propName) const throw (AuroraException)
double getDoubleWithDefault (string propName, double defaultValue) const
string getString (string propName) const throw (AuroraException)
bool isStringPropDefined (string propName) const throw (AuroraException)
string getStringWithDefault (string propName, string defaultValue) const


Constructor & Destructor Documentation

PropsFile::PropsFile string  filepath  )  throw (AuroraException)
 

PropsFile::PropsFile string  filepath,
string  prefix,
int  argc,
const char *  argv[]
throw (AuroraException)
 

PropsFile::~PropsFile  )  [virtual]
 


Member Function Documentation

map< string, string > PropsFile::findPropsByPrefix string  prefix  )  const throw (AuroraException)
 

bool PropsFile::getBool string  propName  )  const throw (AuroraException)
 

bool PropsFile::getBoolWithDefault string  propName,
bool  defaultValue
const
 

double PropsFile::getDouble string  propName  )  const throw (AuroraException)
 

double PropsFile::getDoubleWithDefault string  propName,
double  defaultValue
const
 

int PropsFile::getInt string  propName  )  const throw (AuroraException)
 

int PropsFile::getIntWithDefault string  propName,
int  defaultValue
const
 

long PropsFile::getLong string  propName  )  const throw (AuroraException)
 

long PropsFile::getLongWithDefault string  propName,
long  defaultValue
const
 

string PropsFile::getString string  propName  )  const throw (AuroraException)
 

string PropsFile::getStringWithDefault string  propName,
string  defaultValue
const
 

unsigned int PropsFile::getUInt string  propName  )  const throw (AuroraException)
 

unsigned int PropsFile::getUIntWithDefault string  propName,
unsigned int  defaultValue
const
 

unsigned long PropsFile::getULong string  propName  )  const throw (AuroraException)
 

unsigned long long PropsFile::getULongLong string  propName  )  const throw (AuroraException)
 

unsigned long long PropsFile::getULongLongWithDefault string  propName,
unsigned long long  defaultValue
const
 

unsigned long PropsFile::getULongWithDefault string  propName,
unsigned long  defaultValue
const
 

bool PropsFile::isBoolPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isDoubleDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isIntPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isLongPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isStringPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isUIntPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isULongLongPropDefined string  propName  )  const throw (AuroraException)
 

bool PropsFile::isULongPropDefined string  propName  )  const throw (AuroraException)
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:23 2004 for Borealis by doxygen 1.3.8