mtpfws/mtpfw/common/inc/cmtprequestlogger.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-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 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPREQUESTLOGGER_H
       
    22 #define CMTPREQUESTLOGGER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 //#include "rmtpframework.h"
       
    27 #include "mtpdebug.h"
       
    28 
       
    29 #include <gmxmlcomposer.h>
       
    30 #include <mtp/mtpdataproviderapitypes.h>
       
    31 
       
    32 class TMTPTypeRequest;
       
    33 class TMTPTypeResponse;
       
    34 class CMTPXmlLogger;
       
    35 	
       
    36 /** 
       
    37 @internalComponent
       
    38 */
       
    39 class CMTPRequestLogger : public CBase, public MMDXMLComposerObserver 
       
    40     {
       
    41 public:
       
    42 
       
    43 	IMPORT_C ~CMTPRequestLogger();
       
    44 	IMPORT_C static CMTPRequestLogger* NewL();
       
    45 	IMPORT_C void LogRequestL(const TMTPTypeRequest& aRequest);
       
    46 	IMPORT_C void LogResponseL(const TMTPTypeResponse& aResponse);
       
    47 	IMPORT_C void WriteDataPhaseL(const MMTPType& aData, TMTPTransactionPhase aDataPhase);
       
    48 	IMPORT_C TInt CreateOutputDir(TDes& aTestCaseFn);
       
    49     IMPORT_C void WriteTestCaseL(TDesC& aTestCaseFn, const TMTPTypeResponse& aResponse);
       
    50     
       
    51     public: // from MMDXMLComposerObserver
       
    52 	IMPORT_C void ComposeFileCompleteL();
       
    53     
       
    54 private:    
       
    55     CMTPRequestLogger();
       
    56     void ConstructL();
       
    57     
       
    58 private:
       
    59     // We store all of the test case data upto the response phase as the XML parser requires an
       
    60     // 2nd level active scheduler to be constructed to work in this context.
       
    61     TMTPTypeRequest iCurrentRequest;
       
    62     TBuf<KMaxFileName> iCurrentRToIDataPhaseFN;
       
    63     TBuf<KMaxFileName> iCurrentIToRDataPhaseFN;
       
    64     
       
    65     TInt iCurrentTestCaseId;
       
    66     TBuf<KMaxFileName> iCurrentXMLTestCase;
       
    67     TBuf<KMaxFileName> iCurrentTestOutputDir;
       
    68     RFs iFs;
       
    69     RFile iCurrentTestOutput;
       
    70     CActiveScheduler* s;
       
    71     CMTPXmlLogger* iXMLLogger;
       
    72     //CActiveSchedulerWait iWait;
       
    73     CActiveScheduler* iScheduler;
       
    74     CActiveScheduler* iCurrent;
       
    75     TInt iCurrentSessionID;
       
    76     __FLOG_DECLARATION_MEMBER;
       
    77     };
       
    78 
       
    79 #endif