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 barsreadimpl.h |
|
17 * |
|
18 * @internalComponent |
|
19 * @released |
|
20 */ |
|
21 #ifndef __BARSREADIMPL_H__ |
|
22 #define __BARSREADIMPL_H__ |
|
23 |
|
24 #include "commontypes.h" |
|
25 |
|
26 /** Interprets resource data read from a resource file. |
|
27 |
|
28 To use an instance of this class, pass the buffer containing the resource |
|
29 data to it by calling SetBuffer(). |
|
30 |
|
31 The buffer containing the resource data is created by RResourceFile::AllocReadL()/CResourceFile::AllocReadL() |
|
32 which reads the specified resource into it. |
|
33 |
|
34 The current position within the buffer is always maintained and any request |
|
35 for data is always supplied from the current position. The current position |
|
36 is always updated . |
|
37 |
|
38 Expected behaviour when assignment operator or copy constructor is called: |
|
39 The class doesn't have assignment operator and copy constructor, so the compiler generated |
|
40 ones will be used. The buffer used by the source class instance will be shared with the |
|
41 destination class instance. However source and destination instances will have their own |
|
42 current position pointers, both pointed initially to the same buffer position. |
|
43 |
|
44 @internalComponent |
|
45 @see TResourceReaderImpl::SetBuffer() |
|
46 @see CResourceFile::AllocReadL() */ |
|
47 class TResourceReaderImpl |
|
48 { |
|
49 public: |
|
50 TResourceReaderImpl(); |
|
51 |
|
52 void SetBuffer(const Ptr8* aBuffer); |
|
53 void ResetBuffer(); |
|
54 const TAny* Ptr(); |
|
55 |
|
56 // Read counted strings into allocated buffer |
|
57 Ptr16* ReadHBufCL(); |
|
58 |
|
59 // Build pointer from a counted string |
|
60 PtrC8* ReadTPtrC8L(); |
|
61 PtrC16* ReadTPtrC16L(); |
|
62 |
|
63 TInt ReadInt8L(); |
|
64 TUint32 ReadUint8L(); |
|
65 TInt ReadInt16L(); |
|
66 TInt ReadInt32L(); |
|
67 TUint32 ReadUint32L(); |
|
68 |
|
69 void ReadL(TAny* aPtr,TInt aLength); |
|
70 |
|
71 private: |
|
72 void MovePtrL(const TUint8* aPtr); |
|
73 private: |
|
74 |
|
75 const Ptr8* iBuffer; |
|
76 const TUint8* iCurrentPtr; |
|
77 }; |
|
78 |
|
79 #endif//__BARSREADIMPL_H__ |
|