/**
@class MSyDocHandler
Mixin interface class that is intended to be overridden in an inherited class.
Default stub implementations of all the functions are provided to make it easier
to inherit from. Provides the default handlers for the document
混合类,打算由子类重写,所有函数默认的实现让他更容易被继承,提供文档的默认句柄
*/
class MSyDocHandler
{
public:
/**
@fn virtual void StartElement(const TSyExpatQualified& aName, const RArray< ::TSyExpatAttribute>& aAttributes)
Intended Usage: Called whenever a new element is parsed. The name of the element is stored
新元素被解析时使用,元素名被保存
in aName.
@exception none.
@param aName the element.
@param aAttributes array of attributes, consisting of a prefix and a name and a value.
属性的数组,包含一个前缀、一个名字、一个值
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void StartElement(const TSyExpatQualified& aName, const RArray< ::TSyExpatAttribute>& aAttributes) = 0;
/**
@fn virtual void EndElement(const TSyExpatQualified& aName)
Intended Usage: Called whenever an end element declearation is encountered. The name of
the element being closed.
当遇到一个元素声明时调用,元素的名字被关闭
@exception none.
@param aName the name of the element
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void EndElement(const TSyExpatQualified& aName) = 0;
/**
@fn virtual void CharacterData(const TDesC& aData)
Intended Usage: Called whenever a block of character data is read.
当一个字符块数据被读取时调用
@exception none.
@param aData The block of data
@return none
@pre None
@post Nothing is left on the CleanupStack
@warning The aData block is not null terminated!
*/
virtual void CharacterData(const TDesC& aName) = 0;
/**
@fn virtual void ProcessingInstruction(const TDesC& aTarget, const TDesC& aData)
Intended Usage: Called whenever a block of character data is read.
当读取字符数据块时调用
@exception none.
@param aTarget The processing instruction.
处理的指令
@param aData the data for the processing instruction.
指令所处理的数据
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void ProcessingInstruction(const TDesC& aTarget, const TDesC& aData) = 0;
/**
@fn IMPORT_C virtual void Comment(const TDesC& aData)
Intended Usage: Called whenever a comment is read.
当读取注释时调用
@exception none.
@param aData the comment that has been read.
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void Comment(const TDesC& aData) = 0;
/**
@fn virtual void StartCDataSection()
Intended Usage: Called whenever an end data section is encountered.
当遇到结束数据部分时调用
@exception none.
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void StartCDataSection() = 0;
/**
@fn virtual void EndCDataSection() = 0
Intended Usage: Called whenever an end data section is encountered.
当结束数据部分时调用
@exception none.
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void EndCDataSection() = 0;
/**
@fn void Default(const TDesC& aData)
Intended Usage: This is called for any characters in the XML document for which
there is no applicable handler. This includes both characters that
are part of markup which is of a kind that is not reported
(comments, markup declarations), or characters that are part of a
construct which could be reported but for which no handler has been
supplied. The characters are passed exactly as they were in the XML
document except that they will be encoded in UTF-8 or UTF-16.
Line boundaries are not normalized. Note that a byte order mark
character is not passed to the default handler. There are no
guarantees about how characters are divided between calls to the
default handler: for example, a comment might be split between
multiple calls.
@exception none.
@param aData The block of data that needs to be handled
@return none
@pre None
@post Nothing is left on the CleanupStack
@warning The string is not null terminated
*/
virtual void Default(const TDesC& aData) = 0;
/**
@fn virtual void SetParser(CExpatParserBase* aParser);
Intended Usage: This sets the parser that the mixin class is associated with
This function is guaranteed to be called before the first
method on the interface is called, so the developer will always
have access to the parser that is currently parsing the data.
The default
@exception none.
@param aParser the parser instance associated with the interface
@return none
@pre None
@post Nothing is left on the CleanupStack
*/
virtual void SetParser(CExpatParserBase* aParser) = 0;
protected:
};