|
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.
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. |
Success | P6R::eOk | |
Failure | P6R::eInvalidArg | If pKeyName is NULL or contains a reserved character. If both pBuffer and pWritten are NULL. |
P6R::eNotInitialized | A successful call to initialize was not made before this call. | |
P6R::eFormatError | If length of pSectionName + pKeyName is > P6R::MAX_IDENTIFER_SIZE | |
P6R::eNoMemory | Insufficient memory to look up value. | |
P6R::eNotFound | Key name cannot be found and no default value defined. | |
P6R::eTooSmall | pBuffer is not large enough to hold the required string. |