Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Configuration Class Reference

Base class for configuration databases. More...

#include <Configuration.h>

Inheritance diagram for ACE_Configuration

Inheritance graph
[legend]
Collaboration diagram for ACE_Configuration:

Collaboration graph
[legend]
List of all members.

Public Types

enum  VALUETYPE { STRING, INTEGER, BINARY, INVALID }
 Enumeration for the various types of values we can store. More...


Public Methods

virtual ~ACE_Configuration (void)
 destructor.

virtual const ACE_Configuration_Section_Keyroot_section (void) const
 Returns the root section of this configuration.

virtual int open_section (const ACE_Configuration_Section_Key &base, const ACE_TCHAR *sub_section, int create, ACE_Configuration_Section_Key& result) = 0
virtual int remove_section (const ACE_Configuration_Section_Key &key, const ACE_TCHAR *sub_section, int recursive) = 0
 Removes the <sub_section> from <key>. If recursive is non zero, any subkeys below <sub_section> are remove as well.

virtual int enumerate_values (const ACE_Configuration_Section_Key& key, int index, ACE_TString& name, VALUETYPE& type) = 0
virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, int index, ACE_TString& name) = 0
virtual int set_string_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, const ACE_TString& value) = 0
 sets the value in <key> with <name> to a string of <value>.

virtual int set_integer_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, u_int value) = 0
 sets the value in <key> with <name> to an integer of <value>.

virtual int set_binary_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, const void* data, u_int length) = 0
 sets the value in <key> with <name> to binary data of <data> with <length>.

virtual int get_string_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, ACE_TString& value) = 0
 gets the string value of <name> from <key> and places it in <value>. Returns non zero on error (if value is not a string).

virtual int get_integer_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, u_int& value) = 0
 gets the integer value of <name> from <key> and places it in <value>. Returns non zero on error (if value is not an integer).

virtual int get_binary_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, void*& data, u_int& length) = 0
virtual int find_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, VALUETYPE& type) = 0
virtual int remove_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name) = 0
 Removes the the value <name> from <key>. returns non zero on error.

int expand_path (const ACE_Configuration_Section_Key& key, const ACE_TString& path_in, ACE_Configuration_Section_Key& key_out, int create = 1)
int export_config (const ACE_TCHAR* filename)
int import_config (const ACE_TCHAR* filename)
int operator== (const ACE_Configuration& rhs) const
int operator!= (const ACE_Configuration& rhs) const

Protected Methods

 ACE_Configuration (void)
 Default ctor.

ACE_Section_Key_Internalget_internal_key (const ACE_Configuration_Section_Key& key)
 resolves the internal key from a section key.

int validate_name (const ACE_TCHAR* name)
 ACE_Configuration (const ACE_Configuration& rhs)
ACE_Configuration& operator= (const ACE_Configuration& rhs)

Protected Attributes

ACE_Configuration_Section_Key root_

Detailed Description

Base class for configuration databases.

This class provides an interface for configuration databases.


Member Enumeration Documentation

enum ACE_Configuration::VALUETYPE
 

Enumeration for the various types of values we can store.

Enumeration values:
STRING  
INTEGER  
BINARY  
INVALID  


Constructor & Destructor Documentation

ACE_Configuration::~ACE_Configuration ( void ) [virtual]
 

destructor.

ACE_Configuration::ACE_Configuration ( void ) [protected]
 

Default ctor.

ACE_Configuration::ACE_Configuration ( const ACE_Configuration & rhs ) [protected]
 


Member Function Documentation

int ACE_Configuration::enumerate_sections ( const ACE_Configuration_Section_Key & key,
int Index,
ACE_TString & name ) [pure virtual]
 

method to enumerate through the <name> subsections in <key>. To begin iteration, <index> must zero. to continue iteration, invoke enumerate_sections again while incrementing index. Each iteration will return the <name> of the sub section. This method returns 0 on success, <0 on error and 1 when there are no more subsections to iterate through. Note - you may not delete or add values while enumerating. If you need to do this, you start the enumeration over again.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::enumerate_values ( const ACE_Configuration_Section_Key & key,
int Index,
ACE_TString & name,
VALUETYPE & type ) [pure virtual]
 

method to enumerate through the <name> and <type> of values in a <key>. To begin iteration, <index> must be zero. to continue iteration, invoke enumerate_values again while incrementing index. Each iteration will return the <name> of the value and its <type>. This method returns 0 on success, <0 on error and 1 when there are no more values to iterate through. Note - you may not delete or add values while enumerating. If you need to do this, you start the enumeration over again.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::expand_path ( const ACE_Configuration_Section_Key & key,
const ACE_TString & path_in,
ACE_Configuration_Section_Key & key_out,
int create = 1 )
 

Expands <path_in> to <key_out> from <key>. If create is true, the subsections are created. Returns 0 on success, non zero on error The path consists of sections separated by the backslash '\' or forward slash '/'. Returns 0 on success, -1 if <create) is 0 and the path refers a nonexistant section

int ACE_Configuration::export_config ( const ACE_TCHAR * filename )
 

Exports the configuration database to filename. If <filename> is already present, it is overwritten. This function is deprecated and will be removed in a future version of ACE. Please use either ACE_Registry_ImpExp or ACE_Ini_ImpExp instead.

int ACE_Configuration::find_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
VALUETYPE & type ) [pure virtual]
 

checks to see if an entry of <name> is in <key> and places the data type in <type>. Returns 0 on success (entry is found), -1 on error

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::get_binary_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
void *& data,
u_int & length ) [pure virtual]
 

gets the binary value of <name> from <key> and places a copy in <data> and sets <length> to the length of the data. caller is responsible for deleting <data>. Returns non zero on error (if value is not binary).

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::get_integer_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
u_int & value ) [pure virtual]
 

gets the integer value of <name> from <key> and places it in <value>. Returns non zero on error (if value is not an integer).

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

ACE_Section_Key_Internal * ACE_Configuration::get_internal_key ( const ACE_Configuration_Section_Key & key ) [protected]
 

resolves the internal key from a section key.

int ACE_Configuration::get_string_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
ACE_TString & value ) [pure virtual]
 

gets the string value of <name> from <key> and places it in <value>. Returns non zero on error (if value is not a string).

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::import_config ( const ACE_TCHAR * filename )
 

Imports the configuration database from filename. Any existing data is not removed. This function is deprecated and will be removed in a future version of ACE. Please use ACE_Registry_ImpExp or ACE_Ini_ImpExp instead.

int ACE_Configuration::open_section ( const ACE_Configuration_Section_Key & base,
const ACE_TCHAR * sub_section,
int create,
ACE_Configuration_Section_Key & result ) [pure virtual]
 

Finds a <sub_section> in <base> and places the resulting key in <result>. If create is non zero, the sub_section will be created if it doesn't exist

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::operator!= ( const ACE_Configuration & rhs ) const [inline]
 

Determine if the contents of this object are different from the contents of the object on the right hand side. Returns 0 (False) if they are equal and 1 (True) if they are not equal

ACE_Configuration& ACE_Configuration::operator= ( const ACE_Configuration & rhs ) [protected]
 

int ACE_Configuration::operator== ( const ACE_Configuration & rhs ) const
 

Determine if the contents of this object is the same as the contents of the object on the right hand side. Returns 1 (True) if they are equal and 0 (False) if they are not equal

int ACE_Configuration::remove_section ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * sub_section,
int recursive ) [pure virtual]
 

Removes the <sub_section> from <key>. If recursive is non zero, any subkeys below <sub_section> are remove as well.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::remove_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name ) [pure virtual]
 

Removes the the value <name> from <key>. returns non zero on error.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

const ACE_Configuration_Section_Key & ACE_Configuration::root_section ( void ) const [virtual]
 

Returns the root section of this configuration.

int ACE_Configuration::set_binary_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
const void * data,
u_int length ) [pure virtual]
 

sets the value in <key> with <name> to binary data of <data> with <length>.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::set_integer_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
u_int value ) [pure virtual]
 

sets the value in <key> with <name> to an integer of <value>.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::set_string_value ( const ACE_Configuration_Section_Key & key,
const ACE_TCHAR * name,
const ACE_TString & value ) [pure virtual]
 

sets the value in <key> with <name> to a string of <value>.

Reimplemented in ACE_Configuration_Win32Registry, and ACE_Configuration_Heap.

int ACE_Configuration::validate_name ( const ACE_TCHAR * name ) [protected]
 

tests to see if <name> is valid. <name> must be < 255 characters and not contain the path separator '\', brackets [] or = (maybe just restrict to alphanumeric?) returns non zero if name is not valid


Member Data Documentation

ACE_Configuration_Section_Key ACE_Configuration::root_ [protected]
 


The documentation for this class was generated from the following files:
Generated at Sat Dec 1 11:01:23 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000