testexecfw/stf/stffw/logger/STFLoggingServer/inc/Output.h
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: This file contains the header file of the COutput.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef OUTPUT_H
       
    19 #define OUTPUT_H
       
    20 
       
    21 //  INCLUDES
       
    22 
       
    23 #include "StifLoggerBase.h"
       
    24 #include "LoggerTracing.h"
       
    25 
       
    26 // CONSTANTS
       
    27 // Maximum length of the event ranking
       
    28 const TInt KMaxEventRanking = 5;
       
    29 
       
    30 // Maximum length of the space
       
    31 const TInt KMaxSpace = 1;
       
    32 
       
    33 // Maximum length of the HTML line break('<BR>' + '\n')
       
    34 const TInt KMaxHtmlLineBreak = 6;
       
    35 
       
    36 // Maximum length of the line break(13 or '\' and 10 or 'n' in Symbian OS)
       
    37 const TInt KMaxLineBreak = 2;
       
    38 
       
    39 // MACROS
       
    40 // None
       
    41 
       
    42 // DATA TYPES
       
    43 // None
       
    44 
       
    45 // FUNCTION PROTOTYPES
       
    46 // None
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 // None
       
    50 
       
    51 // CLASS DECLARATION
       
    52 
       
    53 // DESCRIPTION
       
    54 // COutput is a STIF Test Framework StifLoggerBase class.
       
    55 // Class contains a file logging operations.
       
    56 
       
    57 class COutput
       
    58         :public CBase
       
    59     {
       
    60     public:     // Enumerations
       
    61             
       
    62     private:    // Enumerations
       
    63 
       
    64     public:     // Constructors and destructor
       
    65 
       
    66         /**
       
    67         * Two-phased constructor.
       
    68         */
       
    69         static COutput* NewL( const TDesC& aTestPath,
       
    70                                 const TDesC& aTestFile,
       
    71                                 CStifLogger::TLoggerType aLoggerType,
       
    72                                 CStifLogger::TOutput aOutput,
       
    73                                 TBool aOverWrite,
       
    74                                 TBool aWithTimeStamp,
       
    75                                 TBool aWithLineBreak,
       
    76                                 TBool aWithEventRanking,
       
    77                                 TBool aThreadIdToLogFile,
       
    78                                 TBool aCreateLogDir,
       
    79                                 TInt aStaticBufferSize,
       
    80                                 TBool aUnicode,
       
    81                                 TInt aThreadId);
       
    82 
       
    83         /**
       
    84         * Destructor.
       
    85         */
       
    86         virtual ~COutput();
       
    87 
       
    88     public:     // New functions
       
    89 
       
    90         /**
       
    91         * C++ default constructor.
       
    92         */
       
    93         COutput();
       
    94 
       
    95         /**
       
    96         * Pure virtual. Write log information or data to the file.
       
    97         * 16 bit.
       
    98         */
       
    99         virtual TInt Write( TBool /* aWithTimeStamp */,
       
   100                             TBool /* aWithTimeLineBreak */,
       
   101                             TBool /* aWithEventRanking */,
       
   102                             const TDesC& /* aData */ ) = 0;
       
   103 
       
   104         /**
       
   105         * Pure virtual. Write log information or data to the file.
       
   106         * 8 bit.
       
   107         */
       
   108         virtual TInt Write( TBool /* aWithTimeStamp */,
       
   109                             TBool /* aWithTimeLineBreak */,
       
   110                             TBool /* aWithEventRanking */,
       
   111                             const TDesC8& /* aData */ ) = 0;
       
   112 
       
   113         /**
       
   114         * Return output type.
       
   115         */
       
   116         inline TInt OutputCreationResult( CStifLogger::TOutput& aType )
       
   117             { 
       
   118             aType = iType;  
       
   119             return iCreationResult; 
       
   120             };
       
   121             
       
   122         /**
       
   123         * Set output type.
       
   124         */
       
   125         inline void SetOutputCreationResult( TInt aResult, 
       
   126                                                 CStifLogger::TOutput aType )
       
   127             { 
       
   128             iType = aType;  
       
   129             iCreationResult = aResult; 
       
   130             };
       
   131         
       
   132     public:     // Functions from base classes
       
   133 
       
   134     protected:  // New functions
       
   135 
       
   136     protected:  // Functions from base classes
       
   137 
       
   138     private:
       
   139 
       
   140     public:     // Data
       
   141 
       
   142     protected:  // Data
       
   143         // Output type
       
   144         CStifLogger::TOutput    iType;
       
   145         TInt                    iCreationResult;
       
   146 
       
   147     private:    // Data        
       
   148 
       
   149     public:     // Friend classes
       
   150 
       
   151     protected:  // Friend classes
       
   152 
       
   153     private:    // Friend classes
       
   154 
       
   155     };
       
   156 
       
   157 #endif      // OUTPUT_H
       
   158 
       
   159 // End of File