epoc32/include/barsread2.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __BARSREAD2_H__
williamr@2
    17
#define __BARSREAD2_H__
williamr@2
    18
williamr@2
    19
#include <e32std.h>
williamr@2
    20
#include <badesca.h>
williamr@2
    21
williamr@2
    22
//Forward declarations
williamr@2
    23
class TResourceReaderImpl;
williamr@2
    24
class CResourceFile;
williamr@2
    25
williamr@2
    26
/** Interprets resource data read from a resource file.
williamr@2
    27
williamr@2
    28
To use an instance of this class, pass the CResourceFile object containing the resource 
williamr@2
    29
data with aResourceId ID to it, by calling OpenL() or OpenLC(). Close the reader
williamr@2
    30
calling Close() after finishing with the resource.
williamr@2
    31
williamr@2
    32
The current position within the buffer is always maintained and any request 
williamr@2
    33
for data is always supplied from the current position. The current position 
williamr@2
    34
is always updated .
williamr@2
    35
williamr@2
    36
Expected behaviour when assignment operator or copy constructor is called:
williamr@2
    37
The class doesn't have assignment operator and copy constructor, so the compiler generated
williamr@2
    38
ones will be used. The buffer used by the source class instance will be shared with the 
williamr@2
    39
destination class instance. However source and destination instances will have their own 
williamr@2
    40
current position pointers, both pointed initially to the same buffer position.
williamr@2
    41
williamr@2
    42
@publishedAll
williamr@2
    43
@released
williamr@2
    44
@see CResourceFile */
williamr@2
    45
class RResourceReader
williamr@2
    46
	{
williamr@2
    47
public:
williamr@2
    48
	IMPORT_C RResourceReader();
williamr@2
    49
	IMPORT_C ~RResourceReader();
williamr@2
    50
	IMPORT_C void OpenL(const CResourceFile* aRscFile, TInt aResourceId);
williamr@2
    51
	IMPORT_C void OpenLC(const CResourceFile* aRscFile, TInt aResourceId);
williamr@2
    52
	IMPORT_C void OpenL(const TDesC8& aRscData);
williamr@2
    53
	IMPORT_C void OpenLC(const TDesC8& aRscData);
williamr@2
    54
	IMPORT_C void Close();
williamr@2
    55
williamr@2
    56
    // Read counted strings into allocated buffer
williamr@2
    57
    IMPORT_C HBufC*   ReadHBufCL();
williamr@2
    58
    IMPORT_C HBufC8*  ReadHBufC8L();
williamr@2
    59
    IMPORT_C HBufC16* ReadHBufC16L();
williamr@2
    60
williamr@2
    61
    // Build pointer from a counted string
williamr@2
    62
    IMPORT_C TPtrC   ReadTPtrCL();
williamr@2
    63
    IMPORT_C TPtrC8  ReadTPtrC8L();
williamr@2
    64
    IMPORT_C TPtrC16 ReadTPtrC16L();
williamr@2
    65
williamr@2
    66
    // Build an array of strings from a resource array
williamr@2
    67
    IMPORT_C CDesCArrayFlat*   ReadDesCArrayL();
williamr@2
    68
    IMPORT_C CDesC8ArrayFlat*  ReadDesC8ArrayL();
williamr@2
    69
    IMPORT_C CDesC16ArrayFlat* ReadDesC16ArrayL();
williamr@2
    70
williamr@2
    71
    IMPORT_C TInt ReadInt8L();
williamr@2
    72
    IMPORT_C TUint ReadUint8L();
williamr@2
    73
    IMPORT_C TInt ReadInt16L();
williamr@2
    74
    IMPORT_C TUint ReadUint16L();
williamr@2
    75
    IMPORT_C TInt ReadInt32L();
williamr@2
    76
    IMPORT_C TUint ReadUint32L();
williamr@2
    77
    IMPORT_C TReal64 ReadReal64L() __SOFTFP;
williamr@2
    78
williamr@2
    79
    IMPORT_C void ReadL(TAny* aPtr,TInt aLength);
williamr@2
    80
    IMPORT_C void RewindL(TInt aLength);
williamr@2
    81
    IMPORT_C void AdvanceL(TInt aLength);
williamr@2
    82
private:
williamr@2
    83
	TResourceReaderImpl* Impl();
williamr@2
    84
	const TResourceReaderImpl* Impl() const;
williamr@2
    85
private:
williamr@2
    86
	//Size of the RResourceReader implementation.
williamr@2
    87
	//It should be 12 because of the BC reasons.
williamr@2
    88
	//That's the size of the implementation class,
williamr@2
    89
	//which implements TResourceReader functionality too.
williamr@2
    90
	enum
williamr@2
    91
		{
williamr@2
    92
		KRsReaderSize = 12
williamr@2
    93
		};
williamr@2
    94
	TUint8 iImpl[KRsReaderSize];
williamr@2
    95
	HBufC8* iRscBuffer;
williamr@2
    96
	};
williamr@2
    97
williamr@2
    98
#endif//__BARSREAD2_H__