CStifSectionParser Class Reference

class CStifSectionParser : public CBase

Inherits from

Constructor & Destructor Documentation

CStifSectionParser(const TInt)

CStifSectionParser(const TIntaLength)[private]

C++ default constructor.

Parameters

const TInt aLength

~CStifSectionParser()

~CStifSectionParser()

Destructor.

Member Functions Documentation

ConstructL()

voidConstructL()[private]

By default Symbian OS constructor is private.

Des()

const TPtrCDes()

Returns a current section.

FindTag(const TDesC &, const TDesC &, TInt &, TInt &)

TInt FindTag(const TDesC &aText,
const TDesC &aTag,
TInt &aStartPos,
TInt &aEndPos
)[private]

Searches for selected tag in a text.

Parameters

const TDesC & aText
const TDesC & aTag
TInt & aStartPos
TInt & aEndPos

GetItemLineL(const TDesC &, TTagToReturnValue)

IMPORT_C CStifItemParser *GetItemLineL(const TDesC &aTag,
TTagToReturnValueaTagIndicator = ETag
)

Parses a line for items parsing with a tag. Returns a CStifItemParser object. If start tag is empty the parsing starts beging of the section. TTagToReturnValue indicates will also the aTag value (if exist) include to the returned object(For default the tag will be added).

Parameters

const TDesC & aTag
TTagToReturnValue aTagIndicator = ETag

GetLine(const TDesC &, TPtrC &, TTagToReturnValue)

IMPORT_C TIntGetLine(const TDesC &aTag,
TPtrC &aLine,
TTagToReturnValueaTagIndicator = ETag
)

Get a line from section with a tag. Returns an error code and a reference to the parsed line. If start tag is empty the parsing starts beging of the section. TTagToReturnValue indicates will also the aTag value(if exist) include to the aLine reference(For default the tag will be added).

Parameters

const TDesC & aTag
TPtrC & aLine
TTagToReturnValue aTagIndicator = ETag

GetNextItemLineL()

IMPORT_C CStifItemParser *GetNextItemLineL()

Parses a next line for items parsing. Returns a CStifItemParser object.

GetNextItemLineL(const TDesC &, TTagToReturnValue)

IMPORT_C CStifItemParser *GetNextItemLineL(const TDesC &aTag,
TTagToReturnValueaTagIndicator = ETag
)

Parses a next line for items parsing with a tag. Returns a CStifItemParser object. If start tag is empty the parsing starts beging of the section. TTagToReturnValue indicates will also the aTag value (if exist) include to the returned object(For default the tag will be added).

Parameters

const TDesC & aTag
TTagToReturnValue aTagIndicator = ETag

GetNextLine(TPtrC &)

IMPORT_C TIntGetNextLine(TPtrC &aLine)

Get next line. Returns an error code and a reference to the parsed line.

Parameters

TPtrC & aLine

GetNextLine(const TDesC &, TPtrC &, TTagToReturnValue)

IMPORT_C TIntGetNextLine(const TDesC &aTag,
TPtrC &aLine,
TTagToReturnValueaTagIndicator = ETag
)

Get next line with tag. Returns an error code and a reference to the parsed line. If start tag is empty the parsing starts beging of the section. TTagToReturnValue indicates will also the aTag value(if exist) include to the aLine reference(For default the tag will be added).

Parameters

const TDesC & aTag
TPtrC & aLine
TTagToReturnValue aTagIndicator = ETag

GetPosition()

IMPORT_C TIntGetPosition()

Get current position. Returns current parsing position, which can be used as parameter for SetPosition afterwards to go back to old parsing position.

GotoEndOfLine(TLex &)

TInt GotoEndOfLine(TLex &lex)[private]

Generic search for end-of-line. Returns position before linefeed and lex is posotioned to the beginning of next line.

Parameters

TLex & lex

NewL(const TInt)

CStifSectionParser *NewL(const TIntaLength)[static]

Two-phased constructor.

Parameters

const TInt aLength

NextSubSectionL(const TDesC &, const TDesC &, TInt)

IMPORT_C CStifSectionParser *NextSubSectionL(const TDesC &aStartTag,
const TDesC &aEndTag,
TIntaSeeked = 1
)

Parses a next subsections from the main section with a start and with a end tag. Returns a CStifSectionParser object. If start tag is empty the parsing starts beging of the section. If end tag is empty the parsing goes end of section. This method will parse next subsection after the earlier subsection if aSeeked parameter is not given. If configuration file includes several subsections with both start and end tags so aSeeked parameter seeks the required subsection. The aSeeked parameters indicates subsection that will be parsed.

Parameters

const TDesC & aStartTag
const TDesC & aEndTag
TInt aSeeked = 1

ParseStartAndEndPos(TPtrC, const TDesC &, TTagToReturnValue, TInt &, TInt &, TInt &)

TInt ParseStartAndEndPos(TPtrCaSection,
const TDesC &aStartTag,
TTagToReturnValueaTagIndicator,
TInt &aStartPos,
TInt &aEndPos,
TInt &aLength
)[private]

Generic start and end position parser for given data. Returns an error code.

Parameters

TPtrC aSection
const TDesC & aStartTag
TTagToReturnValue aTagIndicator
TInt & aStartPos
TInt & aEndPos
TInt & aLength

SetData(TPtr, TInt, TInt)

voidSetData(TPtraData,
TIntaStartPos,
TIntaLength
)

Create a section.

Parameters

TPtr aData
TInt aStartPos
TInt aLength

SetPosition(TInt)

IMPORT_C TIntSetPosition(TIntaPos)

Set position. Returns a Symbian OS error code. aPos indicates the position to which section parser should go. SetPosition can be used to set parsing position, e.g. to rewind back to some old position retrieved with GetPosition.

Parameters

TInt aPos

SubSectionL(const TDesC &, const TDesC &, TInt)

IMPORT_C CStifSectionParser *SubSectionL(const TDesC &aStartTag,
const TDesC &aEndTag,
TIntaSeeked = 1
)

Parses a sub sections from the main section with a start and with a end tag. Returns a CStifSectionParser object. If start tag is empty the parsing starts beging of the section. If end tag is empty the parsing goes end of section. This method will parse next subsection after the earlier subsection if aSeeked parameter is not given. If configuration file includes several subsections with both start and end tags so aSeeked parameter seeks the required subsection. The aSeeked parameters indicates subsection that will be parsed.

Parameters

const TDesC & aStartTag
const TDesC & aEndTag
TInt aSeeked = 1

SubstractLine(const TPtrC &)

TPtrC SubstractLine(const TPtrC &aText)[private]

Substracts line from the begining of selected text.

Parameters

const TPtrC & aText

Member Data Documentation

HBufC * iHBufferSection

HBufC *iHBufferSection[private]

Section length definitions.

TInt iLength

TInt iLength[private]

Section length

TBool iLineIndicator

TBool iLineIndicator[private]

For line and item line parsing. Indicator is GetLine() or GetItemLineL() method used.

TPtr iSection

TPtr iSection[private]

Parsed section with SectionL() or SubSectionL() method.

TInt iSkipAndMarkPos

TInt iSkipAndMarkPos[private]

Indicates position where start the parsing.

TInt iSubOffset

TInt iSubOffset[private]

Indicates position where we are currently(subsection).