messagingappbase/obexmtms/TObexMTM/INC/ObexParsers.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 // $Workfile: ObexParsers.h $
       
    15 // $Author: Simonk $
       
    16 // $Revision: 4 $
       
    17 // $Date: 22/01/02 11:31 $
       
    18 // 
       
    19 //
       
    20 
       
    21 
       
    22 #ifndef __OBEXPARSERS_H__
       
    23 #define __OBEXPARSERS_H__
       
    24 
       
    25 
       
    26 // System includes
       
    27 // User includes
       
    28 #include "parsers.h"        // CMainSectionParser
       
    29 
       
    30 
       
    31 // Forward declarations
       
    32 class CMainTestHarness;
       
    33 class CObexClientTest;
       
    34 class CTestScript;
       
    35 
       
    36 
       
    37 //
       
    38 // CObexMainSectionParser
       
    39 //
       
    40 class CObexMainSectionParser: public CMainSectionParser
       
    41 /**
       
    42  * This class parses the [main] section of OBEX test scripts. There
       
    43  * can only be one main section in a script.
       
    44  */
       
    45     {
       
    46     public:
       
    47         /**
       
    48          * Factory function which creates a new main section parser.
       
    49          * @param aMainTest A handle to the MMS test harness.
       
    50          * @param aScript A handle to the MMS test script.
       
    51          * @return The new main section parser object.
       
    52          */
       
    53         static CObexMainSectionParser* NewL(CMainTestHarness& aMainTest, CTestScript& aScript);
       
    54 
       
    55     protected:
       
    56         void ConstructL();
       
    57         CObexMainSectionParser(CMainTestHarness& aMainTest, CTestScript& aScript);
       
    58     //  void LogCommentL(const TDesC& aComment);
       
    59 
       
    60     private:
       
    61         CMainTestHarness& iMainTest;
       
    62     };
       
    63 
       
    64 
       
    65 
       
    66 //
       
    67 // CNewObexTestCommandParser
       
    68 //
       
    69 class CNewObexTestCommandParser : public CBaseCommandParser
       
    70 /**
       
    71  * This class implements the standard command parser interface.
       
    72  * The only command it parses is the "obex_client_test" command in the
       
    73  * [main] section.
       
    74  */
       
    75     {
       
    76     public:
       
    77         /**
       
    78          * Function which implements the standard command parser interface
       
    79          * to parse supported commands.
       
    80          */
       
    81         void ProcessL();
       
    82         /**
       
    83          * Factory function which creates a new command parser.
       
    84          * @param aScript A handle to the MMS test script.
       
    85          * @param aMainTest A handle to the MMS test harness.
       
    86          * @return The new command parser object.
       
    87          */
       
    88         static CNewObexTestCommandParser* NewL(CTestScript& aScript, CMainTestHarness& aMainTest);
       
    89     private:
       
    90         /**
       
    91          * Second stage constructor. Sets up the list of commands this
       
    92          * parser can parse.
       
    93          */
       
    94         void ConstructL();
       
    95         /** C++ constructor.
       
    96          * @param aScript A handle to the MMS test script.
       
    97          * @param aMainTest A handle to the MMS test harness.
       
    98          */
       
    99         CNewObexTestCommandParser(CTestScript& aScript, CMainTestHarness& aMainTest);
       
   100         CMainTestHarness& iMainTest;
       
   101         CTestScript& iScript;
       
   102     };
       
   103 
       
   104 
       
   105 
       
   106 //
       
   107 // CObexClientSectionParser
       
   108 //
       
   109 class CObexClientSectionParser : public CBaseSectionParser
       
   110 /**
       
   111  * This class parses the OBEX client test section of a test script. It
       
   112  * creates an OBEX client test command parser to parse the commands.
       
   113  */
       
   114     {
       
   115     public:
       
   116         /**
       
   117          * Factory function which creates a new OBEX client test section parser.
       
   118          * @param aMainTest A handle to the OBEX test harness.
       
   119          * @param aScript A handle to the OBEX test script.
       
   120          */
       
   121         static CObexClientSectionParser* NewL(CObexClientTest& aObexClientTest, CTestScript& aScript, const TDesC& aNewSectionName);
       
   122         
       
   123     protected:
       
   124         void LogCommentL(const TDesC& aComment);
       
   125         void ConstructL(const TDesC& aNewSectionName);
       
   126         CObexClientSectionParser(CObexClientTest& aObexTest, CTestScript& aScript);
       
   127 
       
   128     private:
       
   129         CObexClientTest& iObexTest;
       
   130         CTestScript& iScript;
       
   131     };
       
   132 
       
   133 class CObexClientTestCommandParser : public CBaseCommandParser
       
   134 /**
       
   135  * This class parses the commands that are currently in the "obex_client_test" section of a script
       
   136  * file.
       
   137  */
       
   138     {
       
   139     public:
       
   140         /**
       
   141          * Function which implements the standard command parser interface
       
   142          * to parse supported commands.
       
   143          */
       
   144         void ProcessL();
       
   145         /**
       
   146          * Factory function which creates a new command parser.
       
   147          * @param aScript A handle to the OBEX test script.
       
   148          * @param aObexTest A handle to an OBEX test harness to which this parser adds commands.
       
   149          * @return The new command parser object.
       
   150          */
       
   151         static CObexClientTestCommandParser* NewL(CTestScript& aScript, CObexClientTest& aObexTest);
       
   152     private:
       
   153         /**
       
   154          * Second stage constructor. Sets up the list of commands this
       
   155          * parser can parse.
       
   156          */
       
   157         void ConstructL();
       
   158         /** C++ constructor.
       
   159          * @param aScript A handle to the OBEX test script.
       
   160          * @param aMainTest A handle to an OBEX test harness to which this parser adds commands.
       
   161          */
       
   162         CObexClientTestCommandParser(CTestScript& aScript, CObexClientTest& aObexTest);
       
   163         
       
   164     private:
       
   165         CTestScript& iScript;
       
   166         CObexClientTest& iObexTest;
       
   167     };
       
   168 
       
   169 
       
   170 #endif // __OBEXPARSERS_H__