sdkcreationmw/sdkexamples/cppexamples/S60Ex/helperfunctions/logfile.h
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2004, 2006 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#ifndef __LOGFILE_H__
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
#define __LOGFILE_H__
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
// INCLUDES
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
#include <eikapp.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#include <charconv.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
// CONSTANTS
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
_LIT8(KCrLf8, "\r\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
_LIT(KCrLf, "\r\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
static const TInt KAsciiStart = 0x20;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
static const TInt KAsciiEnd = 0x7f;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
static const TInt KHexCharLeft = '<';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
static const TInt KHexCharRight = '>';
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
static const TInt KNumberOfDecimalPlaces = 3;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
// FORWARD DECLARATIONS
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
// Link with the following libraries: EFSRV.LIB HAL.LIB CHARCONV.LIB
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
class CCnvCharacterSetConverter;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
// CLASS DECLARATIONS
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
* CLogFile
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
* Class to generate a text file containing logging information
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
class CLogFile : public CBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
        public:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
            * NewL
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
            * Create a CLogFile object
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
            * @param aFileName the name of the file to create
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
            * @param aInitialiseLog if true, and the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
            * already exists, previous contents will be deleted.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
            * If false, append to any existing contents
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
            * @return a pointer to the created instance of CLogFile
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
            static CLogFile* NewL( const TDesC& aFileName,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
                                   TBool aInitialiseLog );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
            * NewLC
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
            * Create a CLogFile object
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
            * @param aFileName the name of the file to create
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
            * @param aInitialiseLog if true, and the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
            * already exists, previous contents will be deleted.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
            * If false, append to any existing contents.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
            * @return a pointer to the created instance of CLogFile
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
            static CLogFile* NewLC( const TDesC& aFileName,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
                                    TBool aInitialiseLog );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
            * ~CLogFile
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
            * Destroy the object and release all memory objects
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
            virtual ~CLogFile();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
            * Log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
            * Append the byte to the log file (if not a printable char, it
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
            * will be logged as ascii-hex).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
            * @param aByte the byte to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
            void Log( TUint8 aByte );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
            * Log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
            * Append the integer to the log file (logged as ascii-hex)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
            * @param aNumber the integer to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
            void Log( TUint aNumber );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
            * Log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
            * Append text to the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
            * @param aText the text to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
            void Log( const TDesC8& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
            * Log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
            * Append text to the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
            * @param aText the text to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
            void Log( const TDesC& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
            *LogTime
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
            * Append a timestamp to the log file.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
            * Timestamps are in seconds with three decimal places
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
            * (but resolution is limited to system timer tick period).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
            void LogTime();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
            * LogBytes
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
            * Append the bytes to the log file (non-printable bytes will be
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
            * logged as ascii-hex).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
            * @param aBuffer the bytes to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
            void LogBytes( const TDesC8& aBuffer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
            * LogNewline
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
            * Start a newline in the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
            void LogNewline();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
            * SetAutoFlush
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
            * Turn AutoFlush on or off. AutoFlush will automatically flush
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
            * the log file after each write.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
            * @param aOn if true turns AutoFlush on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
            void SetAutoFlush( TBool aOn );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
            * SetAutoTimeStamp
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
            * Turn AutoTimeStamp on or off. AutoTimeStamp will add
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
            * a timestamp to the start of each new line in the log.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
            * @param aOn if true turn AutoTimeStamp on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
            void SetAutoTimeStamp( TBool aOn );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
            * SetAutoNewline
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
            * Turn AutoNewline on or off. AutoNewline
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
            * starts a new line after each log operation.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
            * @param aOn if true turn AutoNewline on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   151
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   152
            void SetAutoNewline( TBool aOn );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   153
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   154
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   155
            * StaticLogL
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   156
            * Static option to append text to the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   157
            * @param aFileName the file to append to
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   158
            * @param aText the text to append
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   159
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   160
            static void StaticLogL( const TDesC& aFileName,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   161
                                    const TDesC8& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   162
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   163
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   164
            * StaticLogL
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   165
            * Static option to append text to the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   166
            * @param aFileName the file to append to
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   167
            * @param aText the text to append
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   168
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   169
            static void StaticLogL( const TDesC& aFileName,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   170
                                    const TDesC& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   171
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   172
        private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   173
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   174
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   175
            * CLogFile
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   176
            * Perform the first phase of two phase construction
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   177
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   178
            CLogFile();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   179
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   180
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   181
            * ConstructL
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   182
            * Perform the second phase construction of a CLogFile object
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   183
            * @param aFileName the file to open
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   184
            * @param aInitialiseLog if true, and the log file already exists,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   185
            * previous contents will be deleted. If false,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   186
            * append to any existing contents
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   187
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   188
            void ConstructL( const TDesC& aFileName, TBool aInitialiseLog );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   189
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   190
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   191
            * LogTimeInternal
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   192
            * Internal function to log time
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   193
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   194
            void LogTimeInternal();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   195
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   196
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   197
            * LogTextInternal
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   198
            * Internal function to log text
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   199
            * @param aText the text to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   200
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   201
            void LogTextInternal( const TDesC8& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   202
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   203
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   204
            * LogByteInternal
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   205
            * internal function to log a byte
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   206
            * @param aByte the byte to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   207
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   208
            void LogByteInternal( TUint8 aByte );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   209
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   210
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   211
            * LogIntInternal
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   212
            * Internal function to log an integer
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   213
            * @param aNumber the integer to log
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   214
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   215
            void LogIntInternal( TUint aNumber );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   216
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   217
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   218
            * StartWrite
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   219
            * Perform any initial operation before the main log operation
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   220
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   221
            void StartWrite();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   222
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   223
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   224
            * EndWrite
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   225
            * Perform any tidying up operations after the main log operation
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   226
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   227
            void EndWrite();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   228
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   229
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   230
            * Write
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   231
            * Do the actual writing, and associated error checking
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   232
            * @param aText the text to write
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   233
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   234
            void Write( const TDesC8& aText );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   235
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   236
        private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   237
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   238
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   239
            * iLogFile handle to the log file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   240
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   241
            RFile       iLogFile;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   242
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   243
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   244
            * iSession file server session
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   245
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   246
            RFs         iSession;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   247
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   248
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   249
            * iLogMillisecsPerTick number of millisecs per system timer tick
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   250
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   251
            TInt        iLogMillisecsPerTick;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   252
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   253
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   254
            * iAutoFlush flag - AutoFlush on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   255
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   256
            TBool       iAutoFlush;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   257
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   258
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   259
            * iAutoTimestamp flag - AutoTimeStamp on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   260
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   261
            TBool       iAutoTimestamp;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   262
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   263
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   264
            * iAutoNewline flag - AutoNewline on
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   265
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   266
            TBool       iAutoNewline;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   267
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   268
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   269
            * iCheckNestDepth internal to check StartWrite and EndWrite have
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   270
            * been called correctly
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   271
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   272
            TInt        iCheckNestDepth;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   273
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   274
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   275
            * iCharacterConverter converts between unicode and
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   276
            * non-unicode characters
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   277
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   278
            CCnvCharacterSetConverter* iCharacterConverter;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   279
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   280
            /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   281
            * iConverterAvailability flag indicating if conversion
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   282
            * is able to occur
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   283
            */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   284
            CCnvCharacterSetConverter::TAvailability iConverterAvailability;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   285
    };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   286
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   287
#endif // __LOGFILE_H__
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   288
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   289
// End of File