Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IWConfig::getConfigString ( const P6WCHAR pSectionName,
const P6WCHAR pKeyName,
const P6WCHAR defaultValue,
P6WCHAR pBuffer,
P6UINT32  cBuffer,
P6UINT32 pWritten 
)
pure virtual

If the section name does not exist then the unnamed section is used as a default.

Returns the string "value" from an existing "name=value" pair in the selected section of a configuration file.

If the value identified by pKeyName does not exist in the section then the defaultValue is returned, and that default value is automatically inserted into the section. In order to save an automatically inserted value to the configuration file on disk make sure that the flushConfigFile has the "withDefaults" flag set to true.

It is possible to determine the existance of a key in a configuration by calling with the following parameters: err = getConfigString( pSectionName, pKeyName, NULL, NULL, &bufSize ); If the key does not exist then the error eNotFound is returned.

Parameters
pSectionName[ in ] Pointer to string defining the section to write the keyName=value pair This parameter can be NULL, thus indicating the main default section of any configuration file.
pKeyName[ in ] Pointer to string defining the name part of: "name=value"
defaultValue[ in ] Pointer to string value to return if key does not exist, set to NULL if no default desired.
pBuffer[ out ] Pointer to buffer to copy the value of the key. If NUULL, then the required size is returned in pWritten.
cBuffer[ in ] Number of characters in the buffer pointed to by pBuffer.
pWritten[ out ] Optional can be NULL, returns the number of characters written into pBuffer. This parameter cannot be NULL when pBuffer is also NULL.
Returns
SuccessP6R::eOk 
FailureP6R::eInvalidArgIf pKeyName is NULL or contains a reserved character. If both pBuffer and pWritten are NULL.
P6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eFormatErrorIf length of pSectionName + pKeyName is > P6R::MAX_IDENTIFER_SIZE
P6R::eNoMemoryInsufficient memory to look up value.
P6R::eNotFoundKey name cannot be found and no default value defined.
P6R::eTooSmallpBuffer is not large enough to hold the required string.