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

Params Class Reference

#include <Params.h>

List of all members.


Detailed Description

A set of parameters named by strings.


Public Types

enum  Req { NOT_REQUIRED, REQUIRED, NON_EMPTY }

Public Member Functions

 Params ()
 Params (const DOMElement *elt) throw (AuroraBadEntityException)
void addFromXml (const DOMElement *elt) throw (AuroraBadEntityException)
bool empty () const
 Returns true if there are no parameters.
string param (string name, Req req=NOT_REQUIRED) const throw (AuroraBadEntityException)
 Return a parameter.
string param (string name, string def) const
 Return a parameter value, or def if the parameter is not present.
template<typename T> bool typedParam (string name, T &value, Req req=NOT_REQUIRED) const throw (AuroraBadEntityException)
 Reads a parameter value into the "value" argument.
string as_string () const
 Returns a string representation of this parameter set.


Member Enumeration Documentation

enum Params::Req
 

Enumeration values:
NOT_REQUIRED 
REQUIRED 
NON_EMPTY 


Constructor & Destructor Documentation

Params::Params  ) 
 

Params::Params const DOMElement *  elt  )  throw (AuroraBadEntityException) [explicit]
 


Member Function Documentation

void Params::addFromXml const DOMElement *  elt  )  throw (AuroraBadEntityException)
 

string Params::as_string  )  const
 

Returns a string representation of this parameter set.

bool Params::empty  )  const
 

Returns true if there are no parameters.

string Params::param string  name,
string  def
const
 

Return a parameter value, or def if the parameter is not present.

string Params::param string  name,
Req  req = NOT_REQUIRED
const throw (AuroraBadEntityException)
 

Return a parameter.

If req is REQUIRED and the attribute is not specified, or if req is NON_EMPTY and the the attribute is not specified or empty (""), throws an exception.

template<typename T>
bool Params::typedParam string  name,
T &  value,
Req  req = NOT_REQUIRED
const throw (AuroraBadEntityException)
 

Reads a parameter value into the "value" argument.

Throws an exception if (a) a value is specified but has an invalid format, or (b) req is REQUIRED but the attribute value is not specified.

You can specify an optional value by setting value before calling this method.


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