CLineReader Class Reference

class CLineReader : public CBase

Line reader for a vCalendar or vCard parser.

Reads in a line at a time for the parser.

Also allows the first character of the next line to be checked to see if it is a space, which can indicate that the line is wrapped. This enables the reading of multi-line property values.

Used by CVersitParser to internalise streams.

Inherits from

Constructor & Destructor Documentation

CLineReader(RReadStream &)

CLineReader(RReadStream &aStream)[protected, inline]

Parameters

RReadStream & aStream

~CLineReader()

IMPORT_C~CLineReader()

Member Functions Documentation

AppendLineIfSpaceNextL()

IMPORT_C TBoolAppendLineIfSpaceNextL()

AppendSpaceL()

IMPORT_C TIntAppendSpaceL()

ConstructL()

IMPORT_C voidConstructL()[protected]

ExpandBufferL(TInt)

IMPORT_C voidExpandBufferL(TIntaCurrentSize)[protected]

Parameters

TInt aCurrentSize

IsSpaceNextL()

IMPORT_C TBoolIsSpaceNextL()

NewL(RReadStream &)

IMPORT_C CLineReader *NewL(RReadStream &aStream)[static]

Parameters

RReadStream & aStream

ReadBase64ValueL(TInt)

voidReadBase64ValueL(TIntaPopValueStart)

Parameters

TInt aPopValueStart

ReadChar(TInt &)

IMPORT_C TUint8ReadChar(TInt &aErr)[protected]

Parameters

TInt & aErr

ReadLineL(TInt, TInt &)

IMPORT_C TIntReadLineL(TIntaPos,
TInt &aErr
)[virtual]

Parameters

TInt aPos
TInt & aErr

ReadLineL(HBufC8 *&, TInt, TInt &)

TInt ReadLineL(HBufC8 *&aHBuf,
TIntaPos,
TInt &aErr
)[private]

Parameters

HBufC8 *& aHBuf
TInt aPos
TInt & aErr

Reserved()

IMPORT_C voidReserved()[private, virtual]

SetPlugIn(MVersitPlugIn *)

voidSetPlugIn(MVersitPlugIn *aPlugIn)[inline]

Sets the plug-in.

Allows implemented functions of the MVersitPlugIn class to be used in specifying options for adding and deleting spaces to/from the buffer.

Specifically, the plug-in is used to determine whether an additional space should be added when appending a line to the buffer (by default a space will be added), and whether the white space at the start of a line should form part of the data (by default it will not form part of the data).

Using a plug-in is optional.

Parameters

MVersitPlugIn * aPlugInA pointer to an MVersitPlugIn instance.

SetSkipWhiteSpaceAtStart(TBool)

voidSetSkipWhiteSpaceAtStart(TBoolaDoSkip)[inline]

Parameters

TBool aDoSkip

Member Enumerations Documentation

Enum anonymous

Defines the initial line size of, and the size of expansions to, the buffer which stores the line being read.

Enumerators

EInitialLineSize = 96

The initial size of the buffer (pointed to by iBuf).

EExpandSize = 16

The size by which the buffer (pointed to by iBuf) is expanded when it has run out of room.

Enum anonymous

Defines values which describe the content of a line that has been read.

This is the return value from the function ReadLine().

Enumerators

ELineHasContent = 0

The line has content (not white space).

ELineIsWhiteSpace = 1

The line has white space only.

ELineIsCRLFOnly = 2

The line has no content, and so is just a carriage return and line feed ("/r/n").

ELineHasColon

The line has a colon This is only used internally. When the line has a colon, ReadLineL will return ELineHasContent for the sake of backwards compatibility.

Member Data Documentation

TPtr8 iBufPtr

TPtr8 iBufPtr

A pointer to a buffer which stores data read from the stream.

Its size on construction is EInitialLineSize, and it is expanded by EExpandSize when necessary.

A copy of this value should not be stored, since the buffer location may change if the buffer is expanded.

Data in the buffer is not lost when the buffer is expanded, but is copied to the new location.

CLineReaderExtension * iExtension

CLineReaderExtension *iExtension[private]

TInt iFirstCharNextLine

TInt iFirstCharNextLine[protected]

HBufC8 * iLineBuf

HBufC8 *iLineBuf[protected]

MVersitPlugIn * iPlugIn

MVersitPlugIn *iPlugIn[private]

RReadStream * iReadStream

RReadStream *iReadStream

A pointer to an RReadStream object, the ReadUint8L() function of which is used to read single characters from the stream.

This is passed into the NewL() function upon construction.

TBool iSkipWhiteSpaceAtStart

TBool iSkipWhiteSpaceAtStart[private]