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

# ACE_Ini_ImpExp Class Reference

Imports the configuration database from filename as strings. Allows non-typed values. (no #, dword: hex:, etc. prefixes) and skips whitespace (tabs and spaces) as in standard .ini and .conf files. Values (to right of equal sign) can be double quote delimited to embed tabs and spaces in the string. Caller must convert string to type. More...

`#include <Configuration_Import_Export.h>`

Inheritance diagram for ACE_Ini_ImpExp

[legend]
Collaboration diagram for ACE_Ini_ImpExp:

[legend]
List of all members.

## Public Methods
| ACE_Ini_ImpExp (ACE_Configuration&)
virtual | ~ACE_Ini_ImpExp (void)
virtual int | import_config (const ACE_TCHAR* filename)
virtual int | export_config (const ACE_TCHAR* filename)
## Private Methods
int | export_section (const ACE_Configuration_Section_Key& section, const ACE_TString& path, FILE* out)
const ACE_TCHAR* | skip_whitespace (const ACE_TCHAR *src)
int | string_has_white_space (const ACE_TCHAR *string_value)
| ACE_Ini_ImpExp (const ACE_Ini_ImpExp&)
ACE_Ini_ImpExp& | operator= (const ACE_Ini_ImpExp&)

## Detailed Description

Imports the configuration database from filename as strings. Allows non-typed values. (no #, dword: hex:, etc. prefixes) and skips whitespace (tabs and spaces) as in standard .ini and .conf files. Values (to right of equal sign) can be double quote delimited to embed tabs and spaces in the string. Caller must convert string to type.

This method allows for lines in the .ini or .conf file like this:

TimeToLive = 100 Delay = FALSE Flags = FF34 Heading = "ACE - Adaptive Communication Environment"

(note leading whitespace (tabs) in examples below)

SeekIndex = 14 TraceLevel = 6 # Can comment lines like this Justification = left_justified

The caller can then retrieve the string with the regular <get_string_value> function and convert the string to the desired data type.

- * - * - * -
  Todo:
    Strings with embedded newlines cause the import to fail Strings with embedded quotes " cause the import to fail Importing/exporting for values in the root section does not work Add dynamic buffer when importing. currently it will not allow importing of values greater than a fixed ammount (4096 bytes)

## Constructor & Destructor Documentation

ACE_Ini_ImpExp::ACE_Ini_ImpExp ( | ACE_Configuration & config )

| Construction

ACE_Ini_ImpExp::~ACE_Ini_ImpExp ( | void )`[virtual]`

| Destructor

ACE_Ini_ImpExp::ACE_Ini_ImpExp ( | const ACE_Ini_ImpExp & )`[private]`

## Member Function Documentation

int ACE_Ini_ImpExp::export_config ( | const ACE_TCHAR * filename )`[virtual]`

| This method exports the entire configuration database to <filename>. Once the file is opened this method calls 'export_section' passing the root section. Reimplemented from ACE_Config_ImpExp_Base.

int ACE_Ini_ImpExp::export_section ( | const ACE_Configuration_Section_Key & section,
| const ACE_TString & path,
| FILE * out )`[private]`

| Method provided by derived classes in order to write one section to the file specified. Called by export_config when exporting the entire configuration object.

int ACE_Ini_ImpExp::import_config ( | const ACE_TCHAR * filename )`[virtual]`

| Imports the configuration database from filename. No existing data is removed. Reimplemented from ACE_Config_ImpExp_Base.

ACE_Ini_ImpExp& ACE_Ini_ImpExp::operator= ( | const ACE_Ini_ImpExp & )`[private]`

const ACE_TCHAR * ACE_Ini_ImpExp::skip_whitespace ( | const ACE_TCHAR * src )`[private]`

| Method to skip whitespaces in a string. Whitespace is defined as: spaces (' ') and tabs ('\t'). Returns a pointer to the first non-whitespace character in the buffer provided. It does return null ('\0') if it is reached

int ACE_Ini_ImpExp::string_has_white_space ( | const ACE_TCHAR * string_value )`[private]`

| Looks in provided string for whitespace. Whitespace is defined as spaces (' ') and tabs ('\t'). Returns true if found and false if not found

The documentation for this class was generated from the following files:

- Configuration_Import_Export.h
- Configuration_Import_Export.cpp