#include <mw/bsp.h>
Link against: biut.lib
class CBaseScriptParser2 : public CActive |
Protected Attributes | |
---|---|
CMsvEntry & | iEntry |
TMsvId | iEntryId |
RFs & | iFs |
CArrayPtrSeg< CParsedField > * | iParsedFieldArray |
HBufC8 * | iReadBuffer |
CRegisteredParserDll & | iRegisteredParserDll |
HBufC * | iSettings |
TLex | iSms |
HBufC * | iSmsBuf |
TBool | iSmsParsed |
Public Member Functions | |
---|---|
CBaseScriptParser2(CRegisteredParserDll &, CMsvEntry &, RFs &) | |
~CBaseScriptParser2() | |
pure virtual void | ParseL(TRequestStatus &, const TDesC &) |
IMPORT_C TUid | ParserUid() |
pure virtual void | ProcessL(TRequestStatus &) |
IMPORT_C void | ResetL() |
IMPORT_C void | RestoreL(CMsvStore &) |
IMPORT_C void | RestoreL(const TFileName &) |
IMPORT_C void | StoreL(CMsvStore &) |
IMPORT_C void | StoreL(const TFileName &) |
Protected Member Functions | |
---|---|
void | ExternalizeL(RMsvWriteStream &) |
void | InternalizeL(RMsvReadStream &) |
IMPORT_C void | UnfoldMessageL() |
Inherited Attributes | |
---|---|
CActive::iStatus |
Inherited Enumerations | |
---|---|
CActive:TPriority |
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).
CArrayPtrSeg< CParsedField > * | iParsedFieldArray | [protected] |
Array of token-value pairs.
Derived classes can use this for storing parsed information (if this is appropriate).
CRegisteredParserDll & | iRegisteredParserDll | [protected] |
Object that loaded the parser. It contains a reference counter of the use of the parser.
HBufC * | iSmsBuf | [protected] |
Pointer to SMS data (intended for Smart Message use).
This is not set by the base class.
TBool | iSmsParsed | [protected] |
Flag intended for Smart Message use.
This is not used by the base class.
IMPORT_C | CBaseScriptParser2 | ( | CRegisteredParserDll & | aRegisteredParserDll, |
CMsvEntry & | aEntry, | |||
RFs & | aFs | |||
) |
Constructor.
This is called by CBIOServerMtm to create a parser object.
Parameters | |
---|---|
aRegisteredParserDll | Object that loaded the parser. It contains a reference counter of the use of the parser. |
aEntry | The message entry the parser should parse |
aFs | Connected file server handle |
IMPORT_C | ~CBaseScriptParser2 | ( | ) |
Destructor.
This deletes iSettings and iReadBuffer and calls iRegisteredParserDll.ReleaseLibrary().
void | ExternalizeL | ( | RMsvWriteStream & | aStream | ) | const [protected] |
void | InternalizeL | ( | RMsvReadStream & | aStream | ) | [protected] |
void | ParseL | ( | TRequestStatus & | aStatus, |
const TDesC & | aSms | |||
) | [pure virtual] |
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 | |
---|---|
aStatus | Asynchronous status word |
aSms | Buffer to parse |
IMPORT_C TUid | ParserUid | ( | ) |
Gets the UID of the BIO message type handled by the parser.
void | ProcessL | ( | TRequestStatus & | aStatus | ) | [pure virtual] |
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 | |
---|---|
aStatus | Asynchronous status word |
IMPORT_C void | ResetL | ( | ) |
Deletes the iParsedFieldArray parsed fields array and sets it to NULL.
IMPORT_C void | RestoreL | ( | const TFileName & | aFileName | ) |
Restores the message data from a specified file.
It restores iSettings from the specified file.
Parameters | |
---|---|
aFileName | File to read from |
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
Parameters | |
---|---|
aFileName | File to write to |
IMPORT_C void | UnfoldMessageL | ( | ) | [protected] |
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.