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

AnyConfig::AcEnvConfig Class Reference

Looks for sections and keys in the environment. More...

#include <AnyConfig.h>

Inheritance diagram for AnyConfig::AcEnvConfig::

AnyConfig::AcWriteableConfig AnyConfig::AcConfiguration List of all members.

Public Methods

 AcEnvConfig ()
 Constructor method. More...

virtual ~AcEnvConfig ()
 Destructor method. More...

virtual void display ()
 Mostly for debugging purposes, write out the configuration to stdout. More...

virtual bool getSectionStr (const char *pSection, const char *pKey, CString &rValue)
 Like getStr() but can fetch keys from another section than the current one. More...

virtual bool getStr (const char *pKey, CString &rValue)
 Retrieve a string from the configuration for the specified key. More...

virtual bool initRequired ()
 Returns true if the derived AcConfiguration requires to be initialized. More...

virtual bool keyExists (const char *pKey)
 Check if a given key exists. More...

virtual void makeKey (const char *pKey, CString &secKey)
 Make a key to look for in the environment. More...

virtual void setSectionStr (const char *pSection, const char *pKey, const char *pValue)
 Like setStr() but can set keys in another section than the current one. More...

virtual void setStr (const char *pKey, const char *pValue)
 Set the configuration item to the passed string value. More...


Private Methods

void ConstructorInclude ()
 Method which must be called first in a constructor. More...

void DestructorInclude ()
 Method which must be called first in a destructor. More...


Detailed Description

Looks for sections and keys in the environment.

The rule is simple, the environment key should be section_key or just key if sections aren't used.


Constructor & Destructor Documentation

AnyConfig::AcEnvConfig::AcEnvConfig ( )
 

Constructor method.

AnyConfig::AcEnvConfig::~AcEnvConfig ( ) [virtual]
 

Destructor method.


Member Function Documentation

void AnyConfig::AcEnvConfig::ConstructorInclude ( ) [private]
 

Method which must be called first in a constructor.

Reimplemented from AnyConfig::AcWriteableConfig.

void AnyConfig::AcEnvConfig::DestructorInclude ( ) [private]
 

Method which must be called first in a destructor.

Reimplemented from AnyConfig::AcWriteableConfig.

void AnyConfig::AcEnvConfig::display ( ) [virtual]
 

Mostly for debugging purposes, write out the configuration to stdout.

Reimplemented from AnyConfig::AcConfiguration.

bool AnyConfig::AcEnvConfig::getSectionStr ( const char * pSection,
const char * pKey,
CString & rValue ) [virtual]
 

Like getStr() but can fetch keys from another section than the current one.

The default implementation just pushes _currentSection on stack, replaces it with the supplied section and calls the regular getStr() function.

Parameters:
pKey   The key to fetch.
pSection   The section to fetch it from.
rValue   The value found, if any.
Returns:
False if the key could not be found in the specified section.

Reimplemented from AnyConfig::AcConfiguration.

bool AnyConfig::AcEnvConfig::getStr ( const char * pKey,
CString & rValue ) [virtual]
 

Retrieve a string from the configuration for the specified key.

Parameters:
pKey   The key to look for (in the current section).
rValue   Will be filled in with the value found.
Returns:
False if the key could not be located in the current section (if any).

Reimplemented from AnyConfig::AcConfiguration.

bool AnyConfig::AcEnvConfig::initRequired ( ) [virtual]
 

Returns true if the derived AcConfiguration requires to be initialized.

See the initialize() function for the various derived classes for more details. Note that this function must return false once the initialization has been done once.

Reimplemented from AnyConfig::AcConfiguration.

bool AnyConfig::AcEnvConfig::keyExists ( const char * pKey ) [virtual]
 

Check if a given key exists.

Parameters:
key   The key to look for in [the current section in] the configuration.
Returns:
True if the key exists.

Reimplemented from AnyConfig::AcConfiguration.

void AnyConfig::AcEnvConfig::makeKey ( const char * pKey,
CString & secKey ) [virtual]
 

Make a key to look for in the environment.

If the current section is not an empty string, makes a new string by concatenating the current section string, an underscore and the supplied key. Otherwise just uses the supplied key.

Parameters:
pKey   The key requested.
secKey   Will be filled in with the constructed environment key.

void AnyConfig::AcEnvConfig::setSectionStr ( const char * pSection,
const char * pKey,
const char * pValue ) [virtual]
 

Like setStr() but can set keys in another section than the current one.

The default implementation just pushes _currentSection on stack, replaces it with the supplied section and calls the regular setStr() function.

Parameters:
pKey   The key to set.
pSection   The section to set it in.
pValue   The value to set it to.

Reimplemented from AnyConfig::AcWriteableConfig.

void AnyConfig::AcEnvConfig::setStr ( const char * pKey,
const char * pValue ) [virtual]
 

Set the configuration item to the passed string value.

Parameters:
pKey   The item to set.
pValue   The value to set it to. This must be a valid pointer to a valid C string.

Reimplemented from AnyConfig::AcWriteableConfig.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 11:34:18 2001 for AnyConfig by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001