IMPSengine/datautils/inc/impsutils.h
branchRCL_3
changeset 17 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
16:6ca72c0fe49a 17:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2002 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: Header file for imps util class
       
    15 * 
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IMPSUTILS_H
       
    20 #define IMPSUTILS_H
       
    21 
       
    22 #include "impsconst.h"
       
    23 #include "impsservercommon.h"
       
    24 #include <f32file.h>
       
    25 #include <s32file.h>
       
    26 
       
    27 // FORWARD DECLARATION
       
    28 class CImpsVariant;
       
    29 
       
    30 // Logging function
       
    31 // This should not be here but no time to create a new file just now.
       
    32 
       
    33 // Client logger
       
    34 class CImpsClientLogger : public CBase
       
    35     {
       
    36     public:
       
    37         IMPORT_C static void Log( TRefByValue<const TDesC> aFmt, ... );
       
    38         virtual ~CImpsClientLogger();
       
    39     };
       
    40 
       
    41 
       
    42 //**********************************
       
    43 // CImpsSettingFile
       
    44 //**********************************
       
    45 // Read key-value pairs from ASCII file
       
    46 class CImpsSettingFile: public CBase
       
    47     {
       
    48     public:
       
    49         /**
       
    50         * Constructor.
       
    51         */
       
    52         IMPORT_C static CImpsSettingFile* NewL(
       
    53             RFs& aFs );
       
    54 
       
    55         IMPORT_C ~CImpsSettingFile();
       
    56 
       
    57         /**
       
    58         * Opens a file. It is closed in destructor!
       
    59         */
       
    60         IMPORT_C void OpenL( TDesC& aResFile );
       
    61 
       
    62         /**
       
    63         * Get the key value. Leave with KErrNotFound if not found.
       
    64         */
       
    65         IMPORT_C TPtrC8 KeyValueL( const TDesC8& aKey );
       
    66 
       
    67     private:
       
    68         CImpsSettingFile( RFs& aFs );
       
    69 
       
    70         void ReadRowL( TPtrC8& aKey, TPtrC8& aValue );
       
    71     private:
       
    72         // Data
       
    73         RFs& iFs;
       
    74         RFileReadStream iReader;
       
    75         TBuf8<128> iRowBuffer;
       
    76         TFileName iFileName;
       
    77         TBool     iOpen;
       
    78 
       
    79     };
       
    80 
       
    81 
       
    82 //**********************************
       
    83 // message service type
       
    84 //**********************************
       
    85 IMPORT_C GLDEF_C TImpsEventType impsService( const CImpsVariant* aVariant,
       
    86                                              TImpsMessageType aMessage );
       
    87 
       
    88 #endif      // ?INCLUDE_H   
       
    89 
       
    90 // End of File