Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

OmSettings Class Reference

This class is used to pass various settings to other OM classes. More...

#include <omsettings.h>

List of all members.

Public Methods

 OmSettings ()
 Create a settings object. More...

 OmSettings (const OmSettings &other)
 Copy constructor. More...

void operator= (const OmSettings &other)
 Assignment operator. More...

 ~OmSettings ()
 Destructor. More...

void set (const std::string &key, const std::string &value)
 Set an option value. More...

void set (const std::string &key, const char *value)
 Set an option value. More...

void set (const std::string &key, int value)
 Set an option value to an integer. More...

void set (const std::string &key, double value)
 Set an option value to a real number. More...

void set (const std::string &key, bool value)
 Set an option value to a boolean. More...

std::string get (const std::string &key) const
 Get a setting value as a string. More...

std::string get (const std::string &key, std::string def) const
 Get a setting value as a string, with default value. More...

int get_int (const std::string &key) const
 Get a setting value as an integer. More...

int get_int (const std::string &key, int def) const
 Get a setting value as an integer, with default value. More...

bool get_bool (const std::string &key) const
 Get a setting value as a boolean. More...

bool get_bool (const std::string &key, bool def) const
 Get a setting value as a boolean, with default value. More...

double get_real (const std::string &key) const
 Get a setting value as an real number. More...

double get_real (const std::string &key, double def) const
 Get a setting value as an real number, with default value. More...

std::string get_description () const
 Returns a string representing the database group object. More...


Public Attributes

Internal * internal


Detailed Description

This class is used to pass various settings to other OM classes.

The settings available are listed in the documentation.


Constructor & Destructor Documentation

OmSettings::OmSettings  
 

Create a settings object.

OmSettings::OmSettings const OmSettings &    other
 

Copy constructor.

The copies are reference-counted, so copies are relatively cheap. Modifications to a copy don't affect other existing copies (the copy is copy-on-write).

OmSettings::~OmSettings  
 

Destructor.


Member Function Documentation

std::string OmSettings::get const std::string &    key,
std::string    def
const
 

Get a setting value as a string, with default value.

Parameters:
key  The key corresponding to the value to retrieve.

std::string OmSettings::get const std::string &    key const
 

Get a setting value as a string.

Parameters:
key  The key corresponding to the value to retrieve.
Exceptions:
OmRangeError  will be thrown for an invalid key.

bool OmSettings::get_bool const std::string &    key,
bool    def
const
 

Get a setting value as a boolean, with default value.

Parameters:
key  The key corresponding to the value to retrieve.

bool OmSettings::get_bool const std::string &    key const
 

Get a setting value as a boolean.

Parameters:
key  The key corresponding to the value to retrieve.
Exceptions:
OmRangeError  will be thrown for an invalid key.

std::string OmSettings::get_description   const
 

Returns a string representing the database group object.

Introspection method.

int OmSettings::get_int const std::string &    key,
int    def
const
 

Get a setting value as an integer, with default value.

Parameters:
key  The key corresponding to the value to retrieve.

int OmSettings::get_int const std::string &    key const
 

Get a setting value as an integer.

Parameters:
key  The key corresponding to the value to retrieve.
Exceptions:
OmRangeError  will be thrown for an invalid key.

double OmSettings::get_real const std::string &    key,
double    def
const
 

Get a setting value as an real number, with default value.

Parameters:
key  The key corresponding to the value to retrieve.

double OmSettings::get_real const std::string &    key const
 

Get a setting value as an real number.

Parameters:
key  The key corresponding to the value to retrieve.
Exceptions:
OmRangeError  will be thrown for an invalid key.

void OmSettings::operator= const OmSettings &    other
 

Assignment operator.

This should be cheap.

void OmSettings::set const std::string &    key,
bool    value
 

Set an option value to a boolean.

Parameters:
key  The name of the option as a string.
value  The value to set the option to.

void OmSettings::set const std::string &    key,
double    value
 

Set an option value to a real number.

Parameters:
key  The name of the option as a string.
value  The value to set the option to.

void OmSettings::set const std::string &    key,
int    value
 

Set an option value to an integer.

Parameters:
key  The name of the option as a string.
value  The value to set the option to.

void OmSettings::set const std::string &    key,
const char *    value
 

Set an option value.

Parameters:
key  The name of the option as a string.
value  The value to set the option to, as a char *.

void OmSettings::set const std::string &    key,
const std::string &    value
 

Set an option value.

Parameters:
key  The name of the option as a string.
value  The value to set the option to, as a string.


The documentation for this class was generated from the following file:
Documentation for Xapian (version 0.5.1).
Generated on 6 Oct 2002 by Doxygen 1.2.15.