memspy/CommandLine/Include/MemSpyCommandLine.h
branchRCL_3
changeset 49 7fdc9a71d314
parent 44 52e343bb8f80
child 59 8ad140f3dd41
equal deleted inserted replaced
46:e26895079d7c 49:7fdc9a71d314
    20 
    20 
    21 // System includes
    21 // System includes
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include <f32file.h>
    23 #include <f32file.h>
    24 #include <badesca.h>
    24 #include <badesca.h>
       
    25 #include <e32cons.h>
       
    26 
       
    27 #include "MemSpyCommands.h"
    25 
    28 
    26 #ifdef _DEBUG
    29 #ifdef _DEBUG
    27 #   define TRACE( x ) x
    30 #   define TRACE( x ) x
    28 #else
    31 #else
    29 #   define TRACE( x )
    32 #   define TRACE( x )
    34 
    37 
    35 // Classes referenced
    38 // Classes referenced
    36 class RFs;
    39 class RFs;
    37 class CCommandLineArguments;
    40 class CCommandLineArguments;
    38 class RMemSpyEngineClientInterface;
    41 class RMemSpyEngineClientInterface;
       
    42 class CConsoleBase;
       
    43 class RMemSpySession;
    39 
    44 
    40 class CMemSpyCommandLine : public CBase
    45 class CMemSpyCommandLine :  public CActive
    41     {
    46     {
    42 public:
    47 public:
    43     static CMemSpyCommandLine* NewLC();
    48     //static CMemSpyCommandLine* NewLC();
       
    49 	static CMemSpyCommandLine* NewLC( CConsoleBase& aConsole );
    44     ~CMemSpyCommandLine();
    50     ~CMemSpyCommandLine();
    45 
    51 
    46 private:
    52 private:
    47     CMemSpyCommandLine();
    53     //CMemSpyCommandLine();
       
    54     CMemSpyCommandLine( CConsoleBase& aConsole );
    48     void ConstructL();
    55     void ConstructL();
    49 
    56 
    50 public: // API
    57 public: // API
    51     void PerformBatchL( const TDesC& aFileName );
    58     //void PerformBatchL( const TDesC& aFileName ); 	//support of the batch files removed 
    52     void PerformOpL( const CCommandLineArguments& aCommandLine );
    59     void PerformOpL( const CCommandLineArguments& aCommandLine );
    53     void PerformSingleOpL( const TDesC& aCommand, const CDesCArray& aParameters );
    60     void PerformSingleOpL( const TDesC& aCommand, const CDesCArray& aParameters );
       
    61     //
       
    62     //AO request method
       
    63     void WaitForInput();
    54 
    64 
    55 private: // Internal methods
    65 private: // Internal methods
    56     void ConnectToMemSpyL();
    66     void ConnectToMemSpyL();
    57     void LaunchMemSpyL();
    67     void LaunchMemSpyL();
    58     CDesCArray* ReadLinesL( RFile& aFile );
    68     CDesCArray* ReadLinesL( RFile& aFile );
    59     void ParseSWMTParametersL( const CDesCArray& aParameters, TInt& aCategories, TDes& aFilter );
    69     void ParseSWMTParametersL( const CDesCArray& aParameters, TInt& aCategories, TDes& aFilter );
    60     TInt FindBatchFile( TDes &aFileName );
    70     TInt FindBatchFile( TDes &aFileName );
    61     TInt FindFile( TDes &aFileName, const TDesC &aDirPath );
    71     TInt FindFile( TDes &aFileName, const TDesC &aDirPath );
    62 
    72 
       
    73 private: // Console write methods
       
    74     void RedrawInputPrompt();
       
    75     void RedrawStatusMessage();
       
    76     void RedrawStatusMessage( const TDesC& aMessage );
       
    77     void ProcessCommandBufferL();
       
    78     void RunL(); // from CActive
       
    79     TInt RunError( TInt aError );
       
    80     void DoCancel();
       
    81     
    63 private: // Data members
    82 private: // Data members
    64     RFs iFsSession;
    83     RFs iFsSession;
    65     RMemSpyEngineClientInterface* iMemSpy;
    84     RMemSpyEngineClientInterface* iMemSpy;
       
    85     RMemSpySession* iMemSpySession;
    66     TBool iIsBatch; // For avoiding recursion
    86     TBool iIsBatch; // For avoiding recursion
       
    87     
       
    88 private: // Data members - console - write status messages
       
    89     CConsoleBase& iConsole;
       
    90     TPoint iCommandPromptPos;
       
    91     TPoint iStatusMessagePos;
       
    92     TBuf<KMemSpyMaxInputBufferLength> iCommandBuffer;
    67     };
    93     };
    68 
    94 
    69 
    95 
    70 #endif
    96 #endif