secureswitools/swisistools/source/rscparser/barsread2.h
branchRCL_3
changeset 25 7333d7932ef7
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 /** 
       
    16 * @file barsread2.h
       
    17 *
       
    18 * @internalComponent
       
    19 * @released
       
    20 */
       
    21 #ifndef __BARSREAD2_H__
       
    22 #define __BARSREAD2_H__
       
    23 
       
    24 #include "commontypes.h"
       
    25 
       
    26 //Forward declarations
       
    27 class TResourceReaderImpl;
       
    28 class CResourceFile;
       
    29 
       
    30 /** Interprets resource data read from a resource file.
       
    31 
       
    32 To use an instance of this class, pass the CResourceFile object containing the resource 
       
    33 data with aResourceId ID to it, by calling OpenL() or OpenLC(). Close the reader
       
    34 calling Close() after finishing with the resource.
       
    35 
       
    36 The current position within the buffer is always maintained and any request 
       
    37 for data is always supplied from the current position. The current position 
       
    38 is always updated .
       
    39 
       
    40 Expected behaviour when assignment operator or copy constructor is called:
       
    41 The class doesn't have assignment operator and copy constructor, so the compiler generated
       
    42 ones will be used. The buffer used by the source class instance will be shared with the 
       
    43 destination class instance. However source and destination instances will have their own 
       
    44 current position pointers, both pointed initially to the same buffer position.
       
    45 
       
    46 @publishedAll
       
    47 @released
       
    48 @see CResourceFile */
       
    49 class RResourceReader
       
    50 	{
       
    51 public:
       
    52 	 RResourceReader();
       
    53 	 ~RResourceReader();
       
    54 	 void	 OpenL(CResourceFile* aRscFile, TInt aResourceId);
       
    55 	 void	 Close();
       
    56 
       
    57     // Read counted strings into allocated buffer
       
    58      Ptr16*	 ReadHBufCL();
       
    59 
       
    60 	 // Build pointer from a counted string
       
    61      PtrC16* ReadTPtrCL();
       
    62      PtrC8*  ReadTPtrC8L();
       
    63      PtrC16* ReadTPtrC16L();
       
    64 
       
    65      TInt	 ReadInt8L();
       
    66      TUint32 ReadUint8L();
       
    67      TInt	 ReadInt16L();
       
    68 	 TInt	 ReadInt32L();
       
    69      TUint32 ReadUint32L();
       
    70 
       
    71      void	 ReadL(TAny* aPtr,TInt aLength);
       
    72 
       
    73 private:
       
    74 	TResourceReaderImpl* Impl();
       
    75 	const TResourceReaderImpl* Impl() const;
       
    76 private:
       
    77 	//Size of the RResourceReader implementation.
       
    78 	//It should be 12 because of the BC reasons.
       
    79 	//That's the size of the implementation class,
       
    80 	//which implements TResourceReader functionality too.
       
    81 	enum
       
    82 		{
       
    83 		KRsReaderSize = 8
       
    84 		};
       
    85 	TUint8 iImpl[KRsReaderSize];
       
    86 	Ptr8* iRscBuffer;
       
    87 	};
       
    88 
       
    89 #endif//__BARSREAD2_H__