Location:
BSP.H
Link against: biut.lib
class CBaseScriptParser2 : public CActive;
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).
CBase
- Base class for all classes to be instantiated on the heap
CActive
- The core class of the active object abstraction
CBaseScriptParser2
- Base class for BIO message parsers V2
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()
IMPORT_C CBaseScriptParser2(CRegisteredParserDll &aRegisteredParserDll, CMsvEntry &aEntry, RFs &aFs);
Constructor.
This is called by CBIOServerMtm
to create a parser object.
|
IMPORT_C ~CBaseScriptParser2();
Destructor.
This deletes iSettings and iReadBuffer and calls iRegisteredParserDll.ReleaseLibrary().
virtual void ParseL(TRequestStatus &aStatus, const TDesC &aSms)=0;
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.
|
virtual void ProcessL(TRequestStatus &aStatus)=0;
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.
|
IMPORT_C TUid ParserUid();
Gets the UID of the BIO message type handled by the parser.
|
IMPORT_C void RestoreL(CMsvStore &aMessageStore);
Restores the parsed fields array.
It restores the iParsedFieldArray array from the specified CMsvStore
.
|
IMPORT_C void StoreL(CMsvStore &aMsvStore) const;
Stores the parsed fields array.
It stores the iParsedFieldArray array in the specified CMsvStore
.
|
IMPORT_C void RestoreL(const TFileName &aFileName);
Restores the message data from a specified file.
It restores iSettings from the specified file.
|
IMPORT_C void StoreL(const TFileName &aFileName) const;
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
|
IMPORT_C void ResetL();
Deletes the iParsedFieldArray parsed fields array and sets it to NULL.
protected: IMPORT_C void UnfoldMessageL();
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.
protected: CRegisteredParserDll & iRegisteredParserDll;
Object that loaded the parser. It contains a reference counter of the use of the parser.
protected: TLex iSms;
Lexer intended for Smart Message use.
This is not used by the base class.
protected: CArrayPtrSeg< CParsedField > * iParsedFieldArray;
Array of token-value pairs.
Derived classes can use this for storing parsed information (if this is appropriate).
protected: TBool iSmsParsed;
Flag intended for Smart Message use.
This is not used by the base class.
protected: HBufC * iSettings;
Pointer to message data.
This is not set by the base class.