#include <AnyConfig.h>
Inheritance diagram for AnyConfig::AcMemConfig::
Public Methods | |
void | AddMemCfgSection (AcMemCfgSection *item) |
void | RemoveMemCfgSection (AcMemCfgSection *item) |
void | DeleteAllMemCfgSection () |
void | ReplaceMemCfgSection (AcMemCfgSection *item, AcMemCfgSection *newItem) |
AcMemCfgSection* | GetFirstMemCfgSection () const |
AcMemCfgSection* | GetLastMemCfgSection () const |
AcMemCfgSection* | GetNextMemCfgSection (AcMemCfgSection *pos) const |
AcMemCfgSection* | GetPrevMemCfgSection (AcMemCfgSection *pos) const |
int | GetMemCfgSectionCount () const |
AcMemConfig () | |
Constructor method. More... | |
virtual | ~AcMemConfig () |
Destructor method. More... | |
virtual bool | copyTo (AcWriteableConfig *pWriteableConfig) |
Copy this configuration to another configuration. More... | |
virtual void | copyTo (CString &rCString) |
Copy this configuration to a stringified representation. More... | |
virtual AcConfiguration* | createFromSection (const char *section) |
Extract a sub-configuration containing only the indicated section. More... | |
virtual void | display () |
Mostly for debugging purposes, display the configuration. 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 | initialize (const char *fromString) |
Build a configuration from a stringified representation. 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 | 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... | |
AcMemCfgSection* | FindEqualOrBiggerMemCfgSection (const CString §ion) |
AcMemCfgSection* | FindEqualOrSmallerMemCfgSection (const CString §ion) |
AcMemCfgSection* | FindMemCfgSection (const CString §ion) |
AcMemCfgSection* | FindReverseMemCfgSection (const CString §ion) |
Protected Methods | |
virtual AcMemCfgItem* | findItem (const char *pSection, const char *pKey) |
Return a pointer to the specified key in the current section, if both exist. 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 | |
AcMemCfgSection* | _topMemCfgSection |
int | _countMemCfgSection |
This configuration class is mostly used for activities like copying configurations or buffering ones that are expensive to use directly. It also allows to "bootstrap" the configuration system by programmatically creating an initial parent configuration.
|
Constructor method.
|
|
Destructor method.
|
|
Method which must be called first in a constructor.
Reimplemented from AnyConfig::AcWriteableConfig. Reimplemented in AnyConfig::AcBufFileConfig. |
|
Method which must be called first in a destructor.
Reimplemented from AnyConfig::AcWriteableConfig. Reimplemented in AnyConfig::AcBufFileConfig. |
|
Copy this configuration to a stringified representation.
|
|
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. |
|
Extract a sub-configuration containing only the indicated section.
If your implementation returns a specialized sub-class for this, make sure it is either not an AcWriteableConfig implementation or if it is that writing to it does not alter the original section's information. Probably your best solution is to return an AcMemConfig with a copy of the section, like the original classes do. Reimplemented from AnyConfig::AcConfiguration. |
|
Mostly for debugging purposes, display the configuration.
Reimplemented from AnyConfig::AcConfiguration. Reimplemented in AnyConfig::AcBufFileConfig. |
|
Return a pointer to the specified key in the current section, if both exist.
|
|
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.
Reimplemented from AnyConfig::AcConfiguration. |
|
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. Reimplemented in AnyConfig::AcBufFileConfig. |
|
Build a configuration from a stringified representation.
|
|
Check if a given key exists.
Reimplemented from AnyConfig::AcConfiguration. |
|
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.
Reimplemented from AnyConfig::AcWriteableConfig. |
|
Set the configuration item to the passed string value.
Reimplemented from AnyConfig::AcWriteableConfig. |