Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__ModuleConfig.html below:
NCBI C++ ToolKit: Configuration Utilities
virtual const char * CConfigException::GetErrCodeString (void) const override Translate from the error code value to its string representation. More...
CConfigException::NCBI_EXCEPTION_DEFAULT (CConfigException, CCoreException) CConfig::CConfig (TParamTree *param_tree, EOwnership own=eTakeOwnership, NStr::ECase use_case=NStr::eNocase) Optionally takes ownership on passed param_tree. More...
CConfig::CConfig (const TParamTree *param_tree, NStr::ECase use_case=NStr::eNocase) Construct, take no tree ownership. More...
CConfig::CConfig (const IRegistry ®, NStr::ECase use_case=NStr::eNocase) Take registry and create a config tree out of it. More...
CConfig::~CConfig () string CConfig::GetString (const string &driver_name, const string ¶m_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 string & CConfig::GetString (const string &driver_name, const string ¶m_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 CConfig::GetInt (const string &driver_name, const string ¶m_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 CConfig::GetDataSize (const string &driver_name, const string ¶m_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 CConfig::GetBool (const string &driver_name, const string ¶m_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 CConfig::GetDouble (const string &driver_name, const string ¶m_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 TParamTree * CConfig::GetTree () const static TParamTree * CConfig::ConvertRegToTree (const IRegistry ®, NStr::ECase use_case=NStr::eNocase) Reconstruct param tree from the application registry. More...
string CConfig::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 CConfig::Get (const string &d, const string &p, EErrAction e, int v, const list< string > *s=NULL) bool CConfig::Get (const string &d, const string &p, EErrAction e, bool v, const list< string > *s=NULL) double CConfig::Get (const string &d, const string &p, EErrAction e, double v, const list< string > *s=NULL) CConfig::CConfig (const CConfig &) CConfig & CConfig::operator= (const CConfig &) const string & CConfig::x_GetString (const string &driver_name, const string ¶m_name, EErrAction on_error, const string &default_value, const list< string > *synonyms) ◆ TParamTree ◆ TParamValue
Instantiation parameters tree.
Plug-in instantiation model is based on class factories. Recursive class factory calls are modeled as tree, where specific subtree is responsible for CF parameters
Definition at line 81 of file ncbi_config.hpp.
◆ EErrAction
Defines how to behave when parameter is missing.
Enumerator eErr_Throw
Throw an exception on error.
eErr_NoThrow
Return default value on error.
Definition at line 103 of file ncbi_config.hpp.
◆ EErrCode Enumerator eParameterMissing
Missing mandatory parameter.
eSynonymDuplicate eInvalidParameter
Invalid parameter value.
Definition at line 55 of file ncbi_config.hpp.
◆ CConfig() [1/4] ◆ CConfig() [2/4] ◆ CConfig() [3/4] ◆ CConfig() [4/4] ◆ ConvertRegToTree()
Reconstruct param tree from the application registry.
-
Parameters
-
reg Application registry (loaded from the INI file)
-
Returns
-
Reconstructed tree (caller is responsible for deletion)
Definition at line 264 of file ncbi_config.cpp.
References CTreeNode< TValue, TKeyGetterP >::AddNode(), NStr::CompareNocase(), debug(), entries, IRegistry::EnumerateEntries(), IRegistry::EnumerateSections(), CTreeNode< TValue, TKeyGetterP >::FindOrCreateNode(), NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, IRegistry::Get(), CTreeNode< TValue, TKeyGetterP >::GetKey(), CTreeNode< TValue, TKeyGetterP >::GetParent(), ITERATE, kIncludeSections, kNodeName, CTreeNode< TValue, TKeyGetterP >::RemoveNode(), s_AddOrReplaceSubNode(), s_ExpandSubNodes(), s_FindSubNode(), s_IsSubNode(), s_List2Set(), s_ParseSubNodes(), NStr::Split(), TreeDepthFirstTraverse(), and x_Print().
Referenced by CConfig::CConfig(), CID2SNPProcessor_Impl::CID2SNPProcessor_Impl(), CPSGDataLoader_Impl::CPSGDataLoader_Impl(), CIncreasingTime::Init(), CCgiApplicationCached::Init(), MakePluginManagerParamTree(), and CGBDataLoader_Native::x_CreateDriver().
◆ Get() [1/4] ◆ Get() [2/4] ◆ Get() [3/4] ◆ Get() [4/4] ◆ GetBool()
Utility function to get an integer element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value)
-
Parameters
-
driver_name Name of the module requesting parameter (used in diagnostics) params Parameters tree param_name Name of the parameter mandatory Error action default_value Default value for missing parameters
-
See also
-
ParamTree_GetString
Definition at line 627 of file ncbi_config.cpp.
References CConfig::eErr_Throw, ERR_POST_X_ONCE, CConfig::GetString(), msg(), NCBI_THROW, and NStr::StringToBool().
Referenced by CCacheReader::CCacheReader(), CPubseq2Reader::CPubseq2Reader(), CPubseqReader::CPubseqReader(), CConfig::Get(), CSimpleClassFactoryImpl< CReader, CCacheReader >::GetParamBool(), CReader::InitParams(), and CCDDDataLoader::SLoaderParams::SLoaderParams().
◆ GetDataSize()
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.
-
Parameters
-
driver_name Name of the module requesting parameter (used in diagnostics) params Parameters tree param_name Name of the parameter mandatory Error action default_value Default value for missing parameters
-
See also
-
ParamTree_GetString
Definition at line 586 of file ncbi_config.cpp.
References CConfig::eErr_Throw, ERR_POST_X_ONCE, CConfig::GetString(), msg(), NCBI_THROW, and NStr::StringToUInt8_DataSize().
Referenced by CSimpleClassFactoryImpl< CReader, CCacheReader >::GetParamDataSize(), NS_GetDataSize(), NS_ValidateDataSize(), and SPubseqGatewaySettings::x_GetDataSize().
◆ GetDouble() ◆ GetErrCodeString() const char * CConfigException::GetErrCodeString ( void ) const overridevirtual ◆ GetInt()
Utility function to get an integer element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value)
-
Parameters
-
driver_name Name of the module requesting parameter (used in diagnostics) params Parameters tree param_name Name of the parameter mandatory Error action default_value Default value for missing parameters
-
See also
-
ParamTree_GetString
Definition at line 546 of file ncbi_config.cpp.
References CConfig::eErr_Throw, ERR_POST_X_ONCE, CConfig::GetString(), msg(), NCBI_THROW, and NStr::StringToInt().
Referenced by CID2SNPProcessor_Impl::CID2SNPProcessor_Impl(), CPubseq2Reader::CPubseq2Reader(), CConfig::Get(), CSimpleClassFactoryImpl< CReader, CCacheReader >::GetParamInt(), CReader::InitParams(), CReaderServiceConnector::InitTimeouts(), and CCDDDataLoader::SLoaderParams::SLoaderParams().
◆ GetString() [1/2] ◆ GetString() [2/2]
Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value)
-
Parameters
-
driver_name Name of the module requesting parameter (used in diagnostics) params Parameters tree param_name Name of the parameter mandatory Error action default_value Default value for missing parameters
Definition at line 472 of file ncbi_config.cpp.
References CConfig::x_GetString().
Referenced by CGICacheReader::CGICacheReader(), CId1Reader::CId1Reader(), CId2Reader::CId2Reader(), CPubseq2Reader::CPubseq2Reader(), CPubseqReader::CPubseqReader(), CConfig::Get(), CConfig::GetBool(), CConfig::GetDataSize(), CConfig::GetDouble(), CConfig::GetInt(), IClassFactory< TClass >::GetParam(), CCDDDataLoader::SLoaderParams::SLoaderParams(), and CIncreasingTime::x_GetDoubleParam().
◆ GetTree() ◆ NCBI_EXCEPTION_DEFAULT() ◆ operator=() ◆ x_GetString() ◆ ~CConfig() ◆ m_ParamTree
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4