NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CConfig Class Reference

Search Toolkit Book for CConfig

#include <corelib/ncbi_config.hpp>

+ Collaboration diagram for CConfig:

Public Types

enum  EErrAction { eErr_Throw , eErr_NoThrow }
 Defines how to behave when parameter is missing. More...
 
typedef CTreePair< string, string, PEqualNocase_ConditionalTParamValue
 Instantiation parameters tree. More...
 
typedef TParamValue::TPairTreeNode TParamTree
 

Public Member Functions

 CConfig (TParamTree *param_tree, EOwnership own=eTakeOwnership, NStr::ECase use_case=NStr::eNocase)
 Optionally takes ownership on passed param_tree. More...
 
 CConfig (const TParamTree *param_tree, NStr::ECase use_case=NStr::eNocase)
 Construct, take no tree ownership. More...
 
 CConfig (const IRegistry &reg, NStr::ECase use_case=NStr::eNocase)
 Take registry and create a config tree out of it. More...
 
 ~CConfig ()
 
string GetString (const string &driver_name, const string &param_name, EErrAction on_error, const string &default_value, const list< string > *synonyms=NULL)
 Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
const stringGetString (const string &driver_name, const string &param_name, EErrAction on_error, const list< string > *synonyms=NULL)
 This version always defaults to the empty string so that it can safely return a reference. More...
 
int GetInt (const string &driver_name, const string &param_name, EErrAction on_error, int default_value, const list< string > *synonyms=NULL)
 Utility function to get an integer element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
Uint8 GetDataSize (const string &driver_name, const string &param_name, EErrAction on_error, unsigned int default_value, const list< string > *synonyms=NULL)
 Utility function to get an integer element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) This function understands KB, MB, GB qualifiers at the end of the string. More...
 
bool GetBool (const string &driver_name, const string &param_name, EErrAction on_error, bool default_value, const list< string > *synonyms=NULL)
 Utility function to get an integer element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
double GetDouble (const string &driver_name, const string &param_name, EErrAction on_error, double default_value, const list< string > *synonyms=NULL)
 Utility function to get a double element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
 
const TParamTreeGetTree () const
 
string Get (const string &d, const string &p, EErrAction e, const string &v, const list< string > *s=NULL)
 Overloading of getters for generic programming. More...
 
int Get (const string &d, const string &p, EErrAction e, int v, const list< string > *s=NULL)
 
bool Get (const string &d, const string &p, EErrAction e, bool v, const list< string > *s=NULL)
 
double Get (const string &d, const string &p, EErrAction e, double v, const list< string > *s=NULL)
 

Static Public Member Functions

static TParamTreeConvertRegToTree (const IRegistry &reg, NStr::ECase use_case=NStr::eNocase)
 Reconstruct param tree from the application registry. More...
 

Protected Member Functions

const stringx_GetString (const string &driver_name, const string &param_name, EErrAction on_error, const string &default_value, const list< string > *synonyms)
 

Protected Attributes

AutoPtr< TParamTreem_ParamTree
 

Private Member Functions

 CConfig (const CConfig &)
 
CConfigoperator= (const CConfig &)
 

Detailed Description

Definition at line 72 of file ncbi_config.hpp.


The documentation for this class was generated from the following files:
Modified on Tue May 07 08:14:20 2024 by modify_doxy.py rev. 669887