CSimpleEnvRegMapper Class Reference
[Application Registry]

Search Toolkit Book for CSimpleEnvRegMapper

#include <env_reg.hpp>

Inheritance diagram for CSimpleEnvRegMapper:

Inheritance graph
[legend]
Collaboration diagram for CSimpleEnvRegMapper:

Collaboration graph
[legend]
List of all members.

Detailed Description

CSimpleEnvRegMapper --.

Treat environment variables named <prefix><name><suffix> as registry entries with section <section> and key <section>. Empty prefixes are legal, but must be specified explicitly. Each section name is limited to a single prefix/suffix pair; however, there are no obstacles to placing multiple such mappings in a CEnvironmentRegistry.

Not used in the default configuration.

Definition at line 153 of file env_reg.hpp.

Public Member Functions

 CSimpleEnvRegMapper (const string &section, const string &prefix, const string &suffix=kEmptyStr)
string RegToEnv (const string &section, const string &name) const
 Returns empty strings for unsupported (section, name) pairs.
bool EnvToReg (const string &env, string &section, string &name) const
 The return value indicates whether the environment variable was appropriately formatted.
string GetPrefix (void) const
 Can be overriden to speed enumeration.

Private Attributes

string m_Section
string m_Prefix
string m_Suffix


Constructor & Destructor Documentation

CSimpleEnvRegMapper::CSimpleEnvRegMapper const string &  section,
const string &  prefix,
const string &  suffix = kEmptyStr
 

Definition at line 242 of file env_reg.cpp.


Member Function Documentation

bool CSimpleEnvRegMapper::EnvToReg const string &  env,
string &  section,
string &  name
const [virtual]
 

The return value indicates whether the environment variable was appropriately formatted.

Implements IEnvRegMapper.

Definition at line 257 of file env_reg.cpp.

References NStr::EndsWith(), NStr::eNocase, m_Prefix, m_Section, m_Suffix, and NStr::StartsWith().

string CSimpleEnvRegMapper::GetPrefix void   )  const [virtual]
 

Can be overriden to speed enumeration.

Reimplemented from IEnvRegMapper.

Definition at line 272 of file env_reg.cpp.

References m_Prefix.

string CSimpleEnvRegMapper::RegToEnv const string &  section,
const string &  name
const [virtual]
 

Returns empty strings for unsupported (section, name) pairs.

Implements IEnvRegMapper.

Definition at line 250 of file env_reg.cpp.

References kEmptyStr, m_Prefix, m_Section, and m_Suffix.


Member Data Documentation

string CSimpleEnvRegMapper::m_Prefix [private]
 

Definition at line 163 of file env_reg.hpp.

Referenced by EnvToReg(), GetPrefix(), and RegToEnv().

string CSimpleEnvRegMapper::m_Section [private]
 

Definition at line 163 of file env_reg.hpp.

Referenced by EnvToReg(), and RegToEnv().

string CSimpleEnvRegMapper::m_Suffix [private]
 

Definition at line 163 of file env_reg.hpp.

Referenced by EnvToReg(), and RegToEnv().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 14:31:36 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:06 2009 by modify_doxy.py rev. 173732