BSUL::CIniDocument16 Class Reference

#include "inifile.h"

Link against: bsulinifile.lib

class BSUL::CIniDocument16 : public CBase

Inherits from

  • BSUL::CIniDocument16

    Detailed Description

    Dom parser for 16 bit ini file. This class provides the functionality to read and write settings of an 16 bit ini file.

    Constructor & Destructor Documentation

    ~CIniDocument16 ( )

    IMPORT_C~CIniDocument16()

    Destructor

    Member Function Documentation

    AddSection ( const TDesC16 & )

    IMPORT_C TIntAddSection(const TDesC16 &aSectionName)
    Add a section to the ini document object
    Post-condition
    a section with that name is created and added to the document object
    ParameterDescription
    aSectionNamethe 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

    CompareDocs ( CIniDocument16 & )

    IMPORT_C TBoolCompareDocs(CIniDocument16 &aDoc)

    Compare two document objects. If names, keys or values differ, a false is returned, else a true is returned.

    ParameterDescription
    aDocname of the document to compare against this object.

    Externalise ( const TDesC & )

    IMPORT_C TIntExternalise(const TDesC &aFileName)

    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.

    ParameterDescription
    aFileNamethe output file name to write to

    Returns: KErrNone if no error Other System Wide errors

    GetKeyValue ( const TDesC16 &, const TDesC16 &, TPtrC16 & )

    IMPORT_C TIntGetKeyValue(const TDesC16 &aSectionName,
    const TDesC16 &aKey,
    TPtrC16 &aValue
    )const
    Get the value of a key within a section
    Post-condition
    aKeyValue now points to the key value
    ParameterDescription
    aSectionNamethe section where the key resides
    aKeythe key name
    aValuepointer to the key value

    Returns: KErrNotFound if either section or keyname not found KErrNone if successful

    GetSectionList ( RArray< TPtrC16 > & )

    IMPORT_C TIntGetSectionList(RArray< TPtrC16 > &aSectionList)const
    Get an array of the section name present in the ini document object Note that any items inside this array will be cleared and the array will be populated with the sections' names from this document object.
    Post-condition
    aSectionList contains all the section name in the document object
    ParameterDescription
    aSectionListan array of descriptor to contain the section name

    Returns: KErrNone if successful, otherwise another of the system-wide error codes

    NewL ( RFs &, const TDesC & )

    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.

    ParameterDescription
    aFsthe handle to the file session
    aFileNamethe ini file name to read from

    Returns: A pointer to a newly created CIniDocument16 object

    RemoveKey ( const TDesC16 &, const TDesC16 & )

    IMPORT_C TIntRemoveKey(const TDesC16 &aSectionName,
    const TDesC16 &aKey
    )
    Remove an existing key within a section if supplied section or key name does not exist, it does nothing
    Post-condition
    if exist that key is removed from the section
    ParameterDescription
    aSectionNamethe name of the section where the key resides
    aKeythe name of the key to be removed

    RemoveSection ( const TDesC16 & )

    IMPORT_C TIntRemoveSection(const TDesC16 &aSectionName)
    Remove an existing section from the ini document object
    Post-condition
    if exist that section is removed from the document object
    ParameterDescription
    aSectionNamethe name of the section to be removed

    Returns: KErrNone if successful KErrNotFound if section does not exist Any other system wide error code

    SetKey ( const TDesC16 &, const TDesC16 &, const TDesC16 & )

    IMPORT_C TIntSetKey(const TDesC16 &aSectionName,
    const TDesC16 &aKey,
    const TDesC16 &aValue
    )

    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

    ParameterDescription
    aSectionNamethe name of the section
    aKeythe name of the key
    aValuethe new value for this key

    Returns: KErrNone if successful,any other system wide error code