#include <AnyConfig.h>
Inheritance diagram for AnyConfig::AcFileConfig::
Public Methods | |
AcFileConfig () | |
Constructor method. More... | |
virtual | ~AcFileConfig () |
Destructor method. More... | |
virtual bool | copyTo (AcWriteableConfig *pWriteableConfig) |
Copy this configuration to another configuration. More... | |
virtual bool | copyTo (FILE *pF, AcWriteableConfig *pWriteableConfig) |
Hack to use for instance stdin. More... | |
virtual void | display () |
Mostly for debugging purposes, write out the configuration to stdout. More... | |
virtual bool | getStr (const char *pKey, CString &rValue) |
Retrieve a string from the configuration for the specified key. More... | |
virtual bool | initialize (AcConfiguration &parentConfig) |
Initialize the configuration using another, probably more primitive, parent configuration. 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 | setStr (const char *pKey, const char *pValue) |
Set the configuration item to the passed string value. More... | |
const CString& | GetCfgFileName () const |
Returns the value of member '_cfgFileName'. More... | |
void | SetCfgFileName (const CString &rCfgFileName) |
Set the value of member '_cfgFileName' to 'rCfgFileName'. More... | |
Protected Methods | |
virtual bool | getNextItem (FILE *pf, CString &rSection, CString &rKey, CString &rValue) |
Retrieves the next key item from an opened text file. 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... | |
Private Attributes | |
CString | _cfgFileName |
This is a rather inefficient implementation as it re-reads and re-writes the file whenever one of its methods are invoked. Use AcBufFileConfig instead if you have large configuration files.
|
Constructor method.
|
|
Destructor method.
|
|
Method which must be called first in a constructor.
Reimplemented from AnyConfig::AcWriteableConfig. |
|
Method which must be called first in a destructor.
Reimplemented from AnyConfig::AcWriteableConfig. |
|
Returns the value of member '_cfgFileName'.
|
|
Set the value of member '_cfgFileName' to 'rCfgFileName'.
|
|
Hack to use for instance stdin.
|
|
Copy this configuration to another configuration.
This method is specifically handy when the source configuration comes from a text file and the destination configuration is AcMemConfig, which offers much more functionality. Along the same lines, this method can be used to save an AcMemConfig in a file. If the target configuration already has filled-in items, the result of this operation is undefined. Some derived classes may end up containing a merged result of the old and the new values (AcMemConfig, AcEnvConfig), other may only contain the copied values (like AcFileConfig).
Reimplemented from AnyConfig::AcConfiguration. |
|
Mostly for debugging purposes, write out the configuration to stdout.
Reimplemented from AnyConfig::AcConfiguration. |
|
Retrieves the next key item from an opened text file.
|
|
Retrieve a string from the configuration for the specified key.
Reimplemented from AnyConfig::AcConfiguration. |
|
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. |
|
Initialize the configuration using another, probably more primitive, parent configuration. To use the AcFileConfig class it must be initialized. Alternatively, the logFilePathName member can be set programmatically.
Reimplemented from AnyConfig::AcConfiguration. |
|
Check if a given key exists.
Reimplemented from AnyConfig::AcConfiguration. |
|
Set the configuration item to the passed string value.
Reimplemented from AnyConfig::AcWriteableConfig. |