applayerprotocols/httptransportfw/Test/T_HttpIntegration/CCmdStandard.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-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 // $Header$
       
    15 // The header file introducing the collection of standard command classes
       
    16 // of the tester framework.
       
    17 // Include Files  
       
    18 // 
       
    19 //
       
    20 
       
    21 #ifndef __STDCMDS_H__
       
    22 #define __STDCMDS_H__
       
    23 
       
    24 //-----------------------------------------------------------------------------
       
    25 //  Include Files  
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <inetprottextutils.h>
       
    29 
       
    30 //-----------------------------------------------------------------------------
       
    31 
       
    32 #include "GT0149.h"
       
    33 #include "TEngine.h"
       
    34 #include "CCmdFamily.h"
       
    35 #include "CCmdBase.h"
       
    36 #include "CLogFile.h"
       
    37 #include "CIFControl.h"
       
    38 #include "CCatalogue.h"
       
    39 #include "TfrLex.h"
       
    40 
       
    41 //-----------------------------------------------------------------------------
       
    42 //	Command:	The '?' command which forces a listing of all available commands
       
    43 
       
    44 class CCmdListAll : public CCmdBase
       
    45 {
       
    46 public:
       
    47 
       
    48 	static CCmdListAll *NewL ( TInt, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
    49 	static CCmdListAll *NewLC( TInt, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
    50 
       
    51 protected:  // from CCmdBase
       
    52 
       
    53 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
    54 
       
    55 public:     // from CCmdBase
       
    56 	TBool Recognize( const TDesC& aCommand );
       
    57 	TInt  ProcessL ( const TDesC& aCommand );
       
    58 };
       
    59 
       
    60 //-----------------------------------------------------------------------------
       
    61 //	Command:	The 'Comment' command (either // or #)
       
    62 
       
    63 class CCmdRemark : public CCmdBase
       
    64 {
       
    65 public:
       
    66 
       
    67 	static CCmdRemark* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
    68 	static CCmdRemark* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
    69 
       
    70 protected:  // from CCmdBase
       
    71 
       
    72 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
    73 
       
    74 public:     // from CCmdBase
       
    75 	TBool Recognize( const TDesC& aCommand );
       
    76 	TInt  ProcessL ( const TDesC& aCommand );
       
    77 };
       
    78 
       
    79 //-----------------------------------------------------------------------------
       
    80 //	Command:	Quit testing.
       
    81 
       
    82 class CCmdExit : public CCmdBase
       
    83 {
       
    84 public:
       
    85 
       
    86 	static CCmdExit* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
    87 	static CCmdExit* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
    88 
       
    89 protected:
       
    90 	
       
    91 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
    92 
       
    93 public:
       
    94 	
       
    95 	TInt  ProcessL ( const TDesC& aCommand );
       
    96 };
       
    97 
       
    98 //-----------------------------------------------------------------------------
       
    99 //	Command:	Set echo mode switch.
       
   100 
       
   101 class CCmdEchoMode : public CCmdBase
       
   102 {
       
   103 public:
       
   104 
       
   105 	static CCmdEchoMode* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   106 	static CCmdEchoMode* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   107 
       
   108 protected:
       
   109 
       
   110 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   111 
       
   112 public:
       
   113 	
       
   114 	TInt  ProcessL ( const TDesC& aCommand );
       
   115 };
       
   116 
       
   117 //-----------------------------------------------------------------------------
       
   118 //	Command:	Hold processing until user presses any key.
       
   119 
       
   120 class CCmdPause : public CCmdBase
       
   121 {
       
   122 public:
       
   123 
       
   124 	static CCmdPause* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   125 	static CCmdPause* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   126 
       
   127 protected:
       
   128 	
       
   129 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   130 
       
   131 public:
       
   132 	
       
   133 	TInt  ProcessL ( const TDesC& aCommand );
       
   134 };
       
   135 
       
   136 //-----------------------------------------------------------------------------
       
   137 //	Command:	Hold processing for a while (n seconds).
       
   138 
       
   139 class CCmdHold : public CCmdBase
       
   140 {
       
   141 public:
       
   142 
       
   143 	static CCmdHold* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   144 	static CCmdHold* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   145 
       
   146 protected:
       
   147 
       
   148 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   149 
       
   150 public:
       
   151 	
       
   152 	TInt  ProcessL ( const TDesC& aCommand );
       
   153 };
       
   154 
       
   155 //-----------------------------------------------------------------------------
       
   156 //	Command:	Set path of output log files.
       
   157 
       
   158 
       
   159 class CCmdLogPath : public CCmdBase
       
   160 {
       
   161 public:
       
   162 
       
   163 	static CCmdLogPath* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   164 	static CCmdLogPath* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   165 
       
   166 protected:
       
   167 
       
   168 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   169 
       
   170 public:
       
   171 	
       
   172 	TInt  ProcessL ( const TDesC& aCommand );
       
   173 };
       
   174 
       
   175 //-----------------------------------------------------------------------------
       
   176 //	Command:	Open/Create a log file.
       
   177 
       
   178 class CCmdLogFile : public CCmdBase
       
   179 {
       
   180 public:
       
   181 
       
   182 	static CCmdLogFile* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   183 	static CCmdLogFile* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   184 
       
   185 protected:
       
   186 
       
   187 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   188 
       
   189 public:
       
   190 
       
   191 	TInt  ProcessL ( const TDesC& aCommand );
       
   192 };
       
   193 
       
   194 //-----------------------------------------------------------------------------
       
   195 //	Command:	End log file, restore the previous one.
       
   196 
       
   197 class CCmdEndLog : public CCmdBase
       
   198 {
       
   199 public:
       
   200 
       
   201 	static CCmdEndLog* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   202 	static CCmdEndLog* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   203 
       
   204 protected:
       
   205 
       
   206 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   207 public:
       
   208 
       
   209 	TInt ProcessL ( const TDesC& aCommand );
       
   210 };
       
   211 
       
   212 //-----------------------------------------------------------------------------
       
   213 //	Command:	Set command prompt.
       
   214 
       
   215 class CCmdSetPrompt : public CCmdBase
       
   216 {
       
   217 public:
       
   218 
       
   219 	static CCmdSetPrompt* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   220 	static CCmdSetPrompt* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   221 
       
   222 protected:  // from CCmdBase
       
   223 
       
   224 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   225 
       
   226 public:     // from CCmdBase
       
   227 
       
   228 	TInt  ProcessL ( const TDesC& aCommand );
       
   229 };
       
   230 
       
   231 //-----------------------------------------------------------------------------
       
   232 //	Command:	Set command file input path.
       
   233 
       
   234 class CCmdSetPath : public CCmdBase
       
   235 {
       
   236 public:
       
   237 
       
   238 	static CCmdSetPath* NewL (TInt aCommandId, const TDesC& aKeyphrase);
       
   239 	static CCmdSetPath* NewLC(TInt aCommandId, const TDesC& aKeyphrase);
       
   240 
       
   241 protected:  // from CCmdBase
       
   242 
       
   243 	void ConstructL(TInt aCommandId, const TDesC& aKeyphrase);
       
   244 
       
   245 public:     // from CCmdBase
       
   246 	
       
   247 	TInt ProcessL(const TDesC& aCommand);
       
   248 };
       
   249 
       
   250 //-----------------------------------------------------------------------------
       
   251 //	Command:	Call (execute) a command file.
       
   252 
       
   253 class CCmdCall : public CCmdBase
       
   254 {
       
   255 public:
       
   256 
       
   257 	static CCmdCall *NewL ( TInt, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
   258 	static CCmdCall *NewLC( TInt, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
   259 
       
   260 protected:
       
   261 
       
   262 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase, const TDesC& aHelpPhrase);
       
   263 
       
   264 public:
       
   265 	
       
   266 	TInt  ProcessL ( const TDesC& aCommand );
       
   267 };
       
   268 
       
   269 
       
   270 //-----------------------------------------------------------------------------
       
   271 //	Command:	Return from current command file.
       
   272 
       
   273 class CCmdReturn : public CCmdBase
       
   274 {
       
   275 public:
       
   276 
       
   277 	static CCmdReturn* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   278 	static CCmdReturn* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   279 
       
   280 protected:
       
   281 
       
   282 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   283 
       
   284 public:
       
   285 	
       
   286 	TInt  ProcessL ( const TDesC& aCommand );
       
   287 };
       
   288 
       
   289 //-----------------------------------------------------------------------------
       
   290 //	Command:	Set check mode switch.
       
   291 
       
   292 class CCmdCheckMode : public CCmdBase
       
   293 {
       
   294 public:
       
   295 
       
   296 	static CCmdCheckMode* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   297 	static CCmdCheckMode* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   298 
       
   299 protected:
       
   300 
       
   301 	void ConstructL( TInt aCommandId, const TDesC& aKeyphrase );
       
   302 
       
   303 public:
       
   304 
       
   305 	TInt  ProcessL ( const TDesC& aCommand );
       
   306 };
       
   307 
       
   308 //-----------------------------------------------------------------------------
       
   309 //	Command:	Print text.
       
   310 
       
   311 class CCmdPrint : public CCmdBase
       
   312 {
       
   313 public:
       
   314 
       
   315 	static CCmdPrint *NewL (TInt, const TDesC &, const TDesC &);
       
   316 	static CCmdPrint *NewLC(TInt, const TDesC &, const TDesC &);
       
   317 
       
   318 protected:  // from CCmdBase
       
   319 
       
   320 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   321 	TBool Recognize(const TDesC& aCommand);
       
   322 
       
   323 public:     // from CCmdBase
       
   324 
       
   325 	TInt  ProcessL(const TDesC& aCommand);
       
   326 
       
   327 private:
       
   328 	TBool iCurEchoMode;
       
   329 };
       
   330 
       
   331 //-----------------------------------------------------------------------------
       
   332 //	Command:	SCRIPT - execute a script from interactive console
       
   333 
       
   334 class CCmdScript : public CCmdBase
       
   335 {
       
   336 public:
       
   337 
       
   338 	static CCmdScript *NewL (TInt, const TDesC &, const TDesC &);
       
   339 	static CCmdScript *NewLC(TInt, const TDesC &, const TDesC &);
       
   340 
       
   341 protected:  // from CCmdBase
       
   342 
       
   343 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   344 
       
   345 public:
       
   346 
       
   347 	TInt ProcessL(const TDesC& aCommand);
       
   348 };
       
   349 
       
   350 //-----------------------------------------------------------------------------
       
   351 //	Command:	Define a tag.
       
   352 
       
   353 class CCmdDefine : public CCmdBase
       
   354 {
       
   355 public:
       
   356 
       
   357 	//static CCmdDefine* NewL ( TInt aCommandId, const TDesC& aKeyphrase );
       
   358 	//static CCmdDefine* NewLC( TInt aCommandId, const TDesC& aKeyphrase );
       
   359 	static CCmdDefine *NewL (TInt, const TDesC &, const TDesC &);
       
   360 	static CCmdDefine *NewLC(TInt, const TDesC &, const TDesC &);
       
   361 
       
   362 protected:  // from CCmdBase
       
   363 
       
   364 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   365 
       
   366 public:     // from CCmdBase
       
   367 	
       
   368 	TInt  ProcessL ( const TDesC& aCommand );
       
   369 };
       
   370 
       
   371 //-----------------------------------------------------------------------------
       
   372 //	Command:	IF. Performs test on given defines and executes next command if 
       
   373 //								true. 
       
   374 
       
   375 class CCmdIf : public CCmdBase
       
   376 {
       
   377 public:
       
   378 
       
   379 	static CCmdIf *NewL (TInt, const TDesC &, const TDesC &);
       
   380 	static CCmdIf *NewLC(TInt, const TDesC &, const TDesC &);
       
   381 
       
   382 protected:  // from CCmdBase
       
   383 
       
   384 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   385 	TBool Recognize(const TDesC& aCommand);
       
   386 
       
   387 public:     // from CCmdBase
       
   388 
       
   389 	TInt  ProcessL ( const TDesC& aCommand );
       
   390 };
       
   391 
       
   392 //-----------------------------------------------------------------------------
       
   393 //	Command:	ELSE. If the preceeding IF fails (i.e result is false)
       
   394 //						then this 'branch' of the script is executed
       
   395 //						not a practial command line type - more useful for scripts!
       
   396 
       
   397 class CCmdElse : public CCmdBase
       
   398 {
       
   399 public:
       
   400 
       
   401 	static CCmdElse *NewL (TInt, const TDesC &, const TDesC &);
       
   402 	static CCmdElse *NewLC(TInt, const TDesC &, const TDesC &);
       
   403 
       
   404 protected:  // from CCmdBase
       
   405 
       
   406 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   407 	TBool Recognize(const TDesC &);
       
   408 
       
   409 public:     // from CCmdBase
       
   410 
       
   411 	TInt ProcessL(const TDesC &);
       
   412 };
       
   413 
       
   414 //-----------------------------------------------------------------------------
       
   415 //	Command:	ENDIF. Closes an IF block does nothing more then ensure that the
       
   416 //						stepover facility is cleared for the following commands
       
   417 
       
   418 class CCmdEndIf : public CCmdBase
       
   419 {
       
   420 public:
       
   421 
       
   422 	static CCmdEndIf *NewL (TInt, const TDesC &, const TDesC &);
       
   423 	static CCmdEndIf *NewLC(TInt, const TDesC &, const TDesC &);
       
   424 
       
   425 protected:  // from CCmdBase
       
   426 
       
   427 	void ConstructL(TInt, const TDesC &, const TDesC &);
       
   428 	TBool Recognize(const TDesC &);
       
   429 
       
   430 public:     // from CCmdBase
       
   431 
       
   432 	TInt ProcessL(const TDesC &);
       
   433 
       
   434 };
       
   435 
       
   436 //-----------------------------------------------------------------------------
       
   437 
       
   438 #endif  // __STDCMDS_H_
       
   439 
       
   440 //-----------------------------------------------------------------------------
       
   441 // End of File
       
   442 //-----------------------------------------------------------------------------