stif/Logger/inc/RDebugOutput.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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 CRDebugOutput.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef RDEBUGOUTPUT_H
       
    19 #define RDEBUGOUTPUT_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <f32file.h>
       
    23 
       
    24 #include "StifLogger.h"
       
    25 #include "Output.h"
       
    26 #include "LoggerTracing.h"
       
    27 
       
    28 // CONSTANTS
       
    29 // None
       
    30 
       
    31 // MACROS
       
    32 // None
       
    33 
       
    34 // DATA TYPES
       
    35 // None
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 // None
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 // None
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 // DESCRIPTION
       
    46 // CRDebugOutput is a STIF Test Framework StifLogger class.
       
    47 // Class contains a RDebug logging operations.
       
    48 class CRDebugOutput 
       
    49             :public COutput
       
    50     {
       
    51     public:     // Enumerations
       
    52 
       
    53     private:    // Enumerations
       
    54 
       
    55     public:     // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         */
       
    60         static CRDebugOutput* NewL( const TDesC& /* aTestPath */,
       
    61                                     const TDesC& /* aTestFile */,
       
    62                                     CStifLogger::TLoggerType aLoggerType,
       
    63                                     TBool /* aOverWrite */,
       
    64                                     TBool aWithTimeStamp,
       
    65                                     TBool aWithLineBreak,
       
    66                                     TBool aWithEventRanking,
       
    67                                     TBool /* aThreadIdToLogFile */,
       
    68                                     TBool /* aCreateLogDir */,
       
    69                                     TInt aStaticBufferSize );
       
    70 
       
    71         /**
       
    72         * Destructor.
       
    73         */
       
    74         ~CRDebugOutput();
       
    75 
       
    76     public:     // New functions
       
    77 
       
    78         /**
       
    79         * Write RDebug information.
       
    80         * 16 bit.
       
    81         */
       
    82         TInt Write( TBool aWithTimeStamp,
       
    83                     TBool aWithLineBreak,
       
    84                     TBool aWithEventRanking,
       
    85                     const TDesC& aData );
       
    86 
       
    87         /**
       
    88         * Write RDebug information.
       
    89         * 8 bit.
       
    90         */
       
    91         TInt Write( TBool aWithTimeStamp,
       
    92                     TBool aWithLineBreak,
       
    93                     TBool aWithEventRanking,
       
    94                     const TDesC8& aData );
       
    95 
       
    96         /**
       
    97         * Event ranking and time stamp combimer.
       
    98         */
       
    99         void EventAndTimeCombiner( TPtr& aLogInfo,
       
   100                                     TPtr& aData,
       
   101                                     TBool aWithTimeStamp,
       
   102                                     TBool aWithLineBreak,
       
   103                                     TBool aWithEventRanking );
       
   104 
       
   105         /**
       
   106         * Add event ranking, specify number to line.
       
   107         */
       
   108         void EventRanking( TPtr& aData );
       
   109                     
       
   110         /**
       
   111         * Add date, time and line break to data.
       
   112         */
       
   113         void AddTimeStampToData( TPtr& aData );
       
   114 
       
   115         /**
       
   116         * Get date and time.
       
   117         */
       
   118         void GetDateAndTime( TStifLoggerTimeStamp8& aDataAndTime );
       
   119 
       
   120     public:     // Functions from base classes
       
   121 
       
   122     protected:  // New functions
       
   123 
       
   124     protected:  // Functions from base classes
       
   125 
       
   126     private:
       
   127 
       
   128         /**
       
   129         * C++ default constructor.
       
   130         */
       
   131         CRDebugOutput( CStifLogger::TLoggerType aLoggerType,
       
   132                         TBool aWithTimeStamp,
       
   133                         TBool aWithLineBreak,
       
   134                         TBool aWithEventRanking );
       
   135 
       
   136         /**
       
   137         * By default Symbian OS constructor is private.
       
   138         */
       
   139         void ConstructL( TInt aStaticBufferSize );
       
   140 
       
   141     public:     // Data
       
   142 
       
   143     protected:  // Data
       
   144 
       
   145     private:    // Data
       
   146 
       
   147         /**
       
   148         * Data buffer
       
   149         */
       
   150         HBufC* iDataHBuf;
       
   151 
       
   152         /**
       
   153         * Indicates file type.
       
   154         */
       
   155         CStifLogger::TLoggerType iLoggerType;
       
   156 
       
   157         /**
       
   158         * Time stamp indicator.
       
   159         */
       
   160         TBool iWithTimeStamp;
       
   161 
       
   162         /**
       
   163         * Line break indicator.
       
   164         */
       
   165         TBool iWithLineBreak;
       
   166 
       
   167         /**
       
   168         * Event ranking indicator.
       
   169         */
       
   170         TBool iWithEventRanking;
       
   171 
       
   172         /**
       
   173         * DataHBuf for logging purposes
       
   174         */      
       
   175         HBufC * iDataHBuf1;      
       
   176 
       
   177         /**
       
   178         * DataHBuf for logging purposes
       
   179         */      
       
   180         HBufC * iDataHBuf2;      
       
   181         
       
   182         TInt iStaticBufferSize;
       
   183        
       
   184     public:     // Friend classes
       
   185 
       
   186     protected:  // Friend classes
       
   187 
       
   188     private:    // Friend classes
       
   189 
       
   190     };
       
   191 
       
   192 #endif      // RDEBUGOUTPUT_H
       
   193 
       
   194 // End of File