inc/xdmlogwriter.h
branchRCL_3
changeset 18 fbd2e7cec7ef
parent 0 c8caa15ef882
equal deleted inserted replaced
17:2669f8761a99 18:fbd2e7cec7ef
       
     1 /*
       
     2 * Copyright (c) 2007 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:   XDM Engine log writer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XDMLOGWRITER__
       
    22 #define __XDMLOGWRITER__
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 _LIT( KXdmLogDir,                                  "XDM" );
       
    27 _LIT( KXdmLogFileExt,                              ".txt" );
       
    28 _LIT( KXdmLogRoot,                                 "C:\\logs\\" );
       
    29 
       
    30 //Determines how many log file instances are
       
    31 //retained until the directory is cleaned up
       
    32 /* E.g. XdmEngine1.txt, XdmEngine2.txt ... XdmEngine10.txt */
       
    33 const TInt KMaxLogFiles                            = 10;
       
    34 
       
    35 /* Default size of the log buffer */
       
    36 const TInt KLogBufferMaxSize		               = 2000;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 class CXdmLogWriter : public CBase
       
    40     {
       
    41     public:
       
    42         
       
    43         /**
       
    44         * Symbian OS constructor
       
    45         *
       
    46         * @param TDesC& The log file name
       
    47         * @return CXdmLogWriter* A log writer instance
       
    48         */ 
       
    49         IMPORT_C static CXdmLogWriter* NewL( const TDesC& aLogName );
       
    50         
       
    51         /**
       
    52         * Write a log string.
       
    53         *
       
    54         * @param TDesC& Log string in 16-bit
       
    55         * @return void
       
    56         */     
       
    57         IMPORT_C void WriteToLog( const TDesC& aLogLine ) const;
       
    58         
       
    59         /**
       
    60         * Write a log string.
       
    61         *
       
    62         * @param TDesC8& Log string in 8-bit
       
    63         * @return void
       
    64         */     
       
    65         IMPORT_C void WriteToLog( const TDesC8& aLogLine  ) const;
       
    66         
       
    67         /**
       
    68         * Destructor
       
    69         */ 
       
    70         virtual ~CXdmLogWriter();
       
    71 
       
    72     private:
       
    73         
       
    74         /**
       
    75         * C++ constructor is private
       
    76         */ 
       
    77         CXdmLogWriter();
       
    78         
       
    79         /**
       
    80         * Symbian OS second-phase constructor
       
    81         * @param TDesC& Name of the log file to write to
       
    82         * @return void
       
    83         */ 
       
    84         void ConstructL( const TDesC& aLogName );
       
    85         
       
    86     private:  //Data
       
    87         
       
    88         HBufC*              iLogFileName;
       
    89     
       
    90     };
       
    91 
       
    92 #endif      //__XDMLOGWRITER__
       
    93             
       
    94 // End of File