mycontenthandler.h

来自「Symbian下解析XML的代码,完全用API解析」· C头文件 代码 · 共 86 行

H
86
字号
/*
============================================================================
 Name        : MyContentHandler.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CMyContentHandler declaration
============================================================================
*/

#ifndef MYCONTENTHANDLER_H
#define MYCONTENTHANDLER_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

#include <xml\contenthandler.h> // for MContentHandler


using namespace Xml;

// CLASS DECLARATION

/**
*  CMyContentHandler
* 
*/
class CMyContentHandler :public MContentHandler
{
public: // Constructors and destructor

	/**
        * Destructor.
        */
	~CMyContentHandler();

        /**
        * Two-phased constructor.
        */
	static CMyContentHandler* NewL();

        /**
        * Two-phased constructor.
        */
	static CMyContentHandler* NewLC();

private:

	/**
        * Constructor for performing 1st stage construction
        */
	CMyContentHandler();

	/**
        * EPOC default constructor for performing 2nd stage construction
        */
	void ConstructL();

private: // from MContentHandler

	void OnStartDocumentL( const RDocumentParameters &aDocParam, TInt aErrorCode );
	void OnEndDocumentL( TInt aErrorCode );
	void OnStartElementL( const RTagInfo &aElement, const RAttributeArray &aAttributes,
		TInt aErrorCode );
	void OnEndElementL( const RTagInfo &aElement, TInt aErrorCode );
	void OnContentL( const TDesC8 &aBytes, TInt aErrorCode );
	void OnStartPrefixMappingL( const RString &aPrefix, const RString &aUri,
		TInt aErrorCode );
	void OnEndPrefixMappingL( const RString &aPrefix, TInt aErrorCode );
	void OnIgnorableWhiteSpaceL( const TDesC8 &aBytes, TInt aErrorCode );
	void OnSkippedEntityL( const RString &aName, TInt aErrorCode );
	void OnProcessingInstructionL( const TDesC8 &aTarget, const TDesC8 &aData,
		TInt aErrorCode);
	void OnError( TInt aErrorCode );
	TAny *GetExtendedInterface( const TInt32 aUid );
private:
	void AppendText( const TDesC& aText );
private:
	 HBufC*     iDisplayResult;
	 HBufC8*       iBuffer;

};

#endif // MYCONTENTHANDLER_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?