Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: BSP.H
Link against: biut.lib

Class CBaseScriptParser2

class CBaseScriptParser2 : public CActive;

Description

Base class for BIO message parsers V2.

Concrete derived classes are implemented in parser DLL's to parse particular types of BIO message.

On receiving an appropriate command (see TBioOperation), the BIO server MTM loads the appropriate parser and passes the message body to it for interpretation. In fact, the parser interface expects the parser to divide its operation into two stages:

1. parsing: which involves extracting information from the raw message body and storing it in a structured format. The parsing stage can also alter the message body, and create files in the directory associated with the message (e.g. parsing a ring tones message will generate a ring tone file).

2. processing: which involves using the extracted information to achieve the purpose of the BIO message (e.g. setting some phone configuration setttings).

This separation allows, for example, a UI to display the parsed information to the user for confirmation, before it is acted upon. For some parsers, however, this two stage division is not sensible, in which case they implement only the first.

The base class provides a pointer iSettings to reference the raw message data, and an array of token-value pairs, iParsedFieldArray, for storing parsed information (if this is appropriate).

Derivation

Members

Defined in CBaseScriptParser2:
CBaseScriptParser2(), ParseL(), ParserUid(), ProcessL(), ResetL(), RestoreL(), RestoreL(), StoreL(), StoreL(), UnfoldMessageL(), iEntry, iEntryId, iFs, iParsedFieldArray, iReadBuffer, iRegisteredParserDll, iSettings, iSms, iSmsBuf, iSmsParsed, ~CBaseScriptParser2()

Inherited from CActive:
Cancel(), Deque(), DoCancel(), EPriorityHigh, EPriorityIdle, EPriorityLow, EPriorityStandard, EPriorityUserInput, Extension_(), IsActive(), IsAdded(), Priority(), RunError(), RunL(), SetActive(), SetPriority(), TPriority, iStatus

Inherited from CBase:
Delete(), operator new()

See also


Construction and destruction


CBaseScriptParser2()

IMPORT_C CBaseScriptParser2(CRegisteredParserDll &aRegisteredParserDll, CMsvEntry &aEntry, RFs &aFs);

Description

Constructor.

This is called by CBIOServerMtm to create a parser object.

Parameters

CRegisteredParserDll &aRegisteredParserDll

Object that loaded the parser. It contains a reference counter of the use of the parser.

CMsvEntry &aEntry

The message entry the parser should parse

RFs &aFs

Connected file server handle


~CBaseScriptParser2()

IMPORT_C ~CBaseScriptParser2();

Description

Destructor.

This deletes iSettings and iReadBuffer and calls iRegisteredParserDll.ReleaseLibrary().

[Top]


Member functions


ParseL()

virtual void ParseL(TRequestStatus &aStatus, const TDesC &aSms)=0;

Description

Called by the BIO server MTM to asynchronously parse message body data.

When parsing is complete, the function should indicate this by setting the message's index field iMtmData3 to 1.

The function should leave if the buffer cannot be parsed successfully.

Parameters

TRequestStatus &aStatus

Asynchronous status word

const TDesC &aSms

Buffer to parse


ProcessL()

virtual void ProcessL(TRequestStatus &aStatus)=0;

Description

Called by the BIO server MTM to asynchronously process the parsed data.

The function takes appropriate parser-specific action on the results of a previous call to ParseL().

When processing is complete, the function should indicate this by setting the message's index field iMtmData3 to 2.

The function should leave if processing is not successful.

Parameters

TRequestStatus &aStatus

Asynchronous status word


ParserUid()

IMPORT_C TUid ParserUid();

Description

Gets the UID of the BIO message type handled by the parser.

Return value

TUid

BIO message type UID


RestoreL()

IMPORT_C void RestoreL(CMsvStore &aMessageStore);

Description

Restores the parsed fields array.

It restores the iParsedFieldArray array from the specified CMsvStore.

Parameters

CMsvStore &aMessageStore

Store to read from


StoreL()

IMPORT_C void StoreL(CMsvStore &aMsvStore) const;

Description

Stores the parsed fields array.

It stores the iParsedFieldArray array in the specified CMsvStore.

Parameters

CMsvStore &aMsvStore

Store to write to


RestoreL()

IMPORT_C void RestoreL(const TFileName &aFileName);

Description

Restores the message data from a specified file.

It restores iSettings from the specified file.

Parameters

const TFileName &aFileName

File to read from


StoreL()

IMPORT_C void StoreL(const TFileName &aFileName) const;

Description

Stores the message data in a specified file.

It stores iSettings in the specified file. Write contents of Smart message to a file as attachment

Parameters

const TFileName &aFileName

File to write to


ResetL()

IMPORT_C void ResetL();

Description

Deletes the iParsedFieldArray parsed fields array and sets it to NULL.


UnfoldMessageL()

protected: IMPORT_C void UnfoldMessageL();

Description

Utility function for unfolding Smart Messages.

Nokia protocol allows for folding of long fields (see Nokia Smart Messaging spec 2.0.0pre, 3-34 and RFC822, 3.1.1). This method unfolds the message by deleting any linefeed characters which are followed immediately by linear white space. It expects the buffer to be in iSmsBuf.

[Top]


Member data


iRegisteredParserDll

protected: CRegisteredParserDll & iRegisteredParserDll;

Description

Object that loaded the parser. It contains a reference counter of the use of the parser.


iEntry

protected: CMsvEntry & iEntry;

Description

The message entry the parser should parse.


iFs

protected: RFs & iFs;

Description

Connected file server handle.


iSms

protected: TLex iSms;

Description

Lexer intended for Smart Message use.

This is not used by the base class.


iParsedFieldArray

protected: CArrayPtrSeg< CParsedField > * iParsedFieldArray;

Description

Array of token-value pairs.

Derived classes can use this for storing parsed information (if this is appropriate).


iSmsParsed

protected: TBool iSmsParsed;

Description

Flag intended for Smart Message use.

This is not used by the base class.


iEntryId

protected: TMsvId iEntryId;

Description

ID of iEntry.


iSettings

protected: HBufC * iSettings;

Description

Pointer to message data.

This is not set by the base class.


iSmsBuf

protected: HBufC * iSmsBuf;

Description

Pointer to SMS data (intended for Smart Message use).

This is not set by the base class.


iReadBuffer

protected: HBufC8 * iReadBuffer;

Description

Temporary pointer used by RestoreL().