xml/legacyminidomparser/xmlparser/test/t_GmxmlFailure.h
changeset 34 c7e9f1c97567
parent 0 e35f40988205
equal deleted inserted replaced
25:417699dc19c9 34:c7e9f1c97567
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32base.h>
       
    17 #include <f32file.h>
       
    18 #include <gmxmlparser.h>
       
    19 
       
    20 /** @file
       
    21  * This file contains the declaration of the generic CGmxmlFailure class
       
    22  * which is responsible for testing the memory leak in the XMLParser.
       
    23  */
       
    24 
       
    25 class CGmxmlFailure : public CActive, public MMDXMLParserObserver
       
    26 	{
       
    27 public:
       
    28 	/** Allocates and constructs a new CGmxmlFailure test.
       
    29 	@return New CGmxmlFailure 
       
    30 	*/
       
    31 	static CGmxmlFailure* NewLC();
       
    32 
       
    33 	// Second constructor
       
    34 	void ConstructL();
       
    35 
       
    36 	/** Constructor. */
       
    37 	CGmxmlFailure();
       
    38 
       
    39 	/** Destructor. */
       
    40 	~CGmxmlFailure();
       
    41 	
       
    42 	/**
       
    43 	 * Functions from MMDXMLParserObserver class
       
    44 	 */
       
    45 	void ParseFileCompleteL();
       
    46 
       
    47 	/**
       
    48 	 * Function from MMDXMLComposerObserver
       
    49 	 */
       
    50 	void ComposeFileCompleteL(); 
       
    51 	
       
    52 	void LoadXmlFile(const TDesC &aFilePath);
       
    53 	void LockXmlFile();
       
    54 	
       
    55 public: // from CActive
       
    56 	void DoCancel();
       
    57 	/*
       
    58 	 * RunL function inherited from CActive base class - carries out the actual 
       
    59 	 * parser leak test.
       
    60 	 * @leave can Leave due to OOM
       
    61 	 */
       
    62 	void RunL();
       
    63 	
       
    64 private:
       
    65 	CMDXMLParser* iCMDXMLParser;
       
    66 	RFs iSession;						// File session for ParseFile.
       
    67 	TInt iState;
       
    68 	enum TStates
       
    69 		{
       
    70 		EEndState = 0x00,
       
    71 		ENonExistFileState,
       
    72 		ELockFileState,
       
    73 		};
       
    74 	};
       
    75 	
       
    76