#include "inifile.h"
class BSUL::CIniDocument16 : public CBase |
Public Member Functions | |
---|---|
~CIniDocument16() | |
IMPORT_C TInt | AddSection(const TDesC16 &) |
IMPORT_C TBool | CompareDocs(CIniDocument16 &) |
IMPORT_C TInt | Externalise(const TDesC &) |
IMPORT_C TInt | GetKeyValue(const TDesC16 &, const TDesC16 &, TPtrC16 &) |
IMPORT_C TInt | GetSectionList(RArray< TPtrC16 > &) |
IMPORT_C CIniDocument16 * | NewL(RFs &, const TDesC &) |
IMPORT_C TInt | RemoveKey(const TDesC16 &, const TDesC16 &) |
IMPORT_C TInt | RemoveSection(const TDesC16 &) |
IMPORT_C TInt | SetKey(const TDesC16 &, const TDesC16 &, const TDesC16 &) |
Dom parser for 16 bit ini file. This class provides the functionality to read and write settings of an 16 bit ini file.
Parameter | Description |
---|---|
aSectionName | the name of the section to be added |
Returns: KErrNone if successful KErrAlreadyExists if the section with that name already exists Any other system wide error code
IMPORT_C TBool | CompareDocs | ( | CIniDocument16 & | aDoc | ) |
Compare two document objects. If names, keys or values differ, a false is returned, else a true is returned.
Parameter | Description |
---|---|
aDoc | name of the document to compare against this object. |
Flush the buffered content to an output file name This will first write into a temporary file in the same directory and path as the supplied aFileName.It will then replace the existing file or create a new file if does not exist yet.
Parameter | Description |
---|---|
aFileName | the output file name to write to |
Returns: KErrNone if no error Other System Wide errors
Parameter | Description |
---|---|
aSectionName | the section where the key resides |
aKey | the key name |
aValue | pointer to the key value |
Returns: KErrNotFound if either section or keyname not found KErrNone if successful
Parameter | Description |
---|---|
aSectionList | an array of descriptor to contain the section name |
Returns: KErrNone if successful, otherwise another of the system-wide error codes
IMPORT_C CIniDocument16 * | NewL | ( | RFs & | aFs, |
const TDesC & | aFileName | |||
) | [static] |
Opening 16 bit ini file for reading.If the supplied file name is a valid ini file, it will instantiate the object and read the content of the ini file.If file not found it will simply instantiate the object. The file is opened for read only and close directly after the construction of this object is complete. User will need to explicitly call Externalise(aFileName) to write the content back to ini file.
Parameter | Description |
---|---|
aFs | the handle to the file session |
aFileName | the ini file name to read from |
Returns: A pointer to a newly created CIniDocument16 object
Parameter | Description |
---|---|
aSectionName | the name of the section where the key resides |
aKey | the name of the key to be removed |
Parameter | Description |
---|---|
aSectionName | the name of the section to be removed |
Returns: KErrNone if successful KErrNotFound if section does not exist Any other system wide error code
Set the value of a key within a section. This API offers the following flexibility: -If section does not exist,create a section and key and value -If section exists but key does not exist, create the key and value -Else replace the existing key value with the new value
Parameter | Description |
---|---|
aSectionName | the name of the section |
aKey | the name of the key |
aValue | the new value for this key |
Returns: KErrNone if successful,any other system wide error code