1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__STOREREADSTREAM_H__)
17 #define __STOREREADSTREAM_H__
19 #include <pcstore/pcstoredef.h>
20 #include <pcstore/streamid.h>
33 A read stream class to internalize data from a Store file.
35 By eventually calling CFileStreamBuf's read function, it implements the internalization of
36 the following data types:
52 After instantiated, it must be opened on a read-moded CDirectFileStore object to internalize data.
53 It must be closed or destroyed before another stream is opened on the same CDirectFileStore object.
56 @see CStoreWriteStream
58 class CStoreReadStream
61 CStoreReadStream(CFileStreamBuf& aStreamBuf, TStreamId aId);
63 void Read(TUint8* aPtr, TInt aLength);
64 void Read(TUint16* aPtr, TInt aLength);
75 void Read(CDes8& aDes);
76 void Read(CDes8& aDes, TInt aLength);
77 void Read(CDes16& aDes);
78 void Read(CDes16& aDes, TInt aLength);
81 CStoreReadStream(const CStoreReadStream& aStream);
82 CStoreReadStream& operator=(const CStoreReadStream& aStream);
89 // Operators on the read stream and data types
90 CStoreReadStream& operator>>(CStoreReadStream& aStream, TStreamId& aId);
91 CStoreReadStream& operator>>(CStoreReadStream& aStream, TInt8& aVal);
92 CStoreReadStream& operator>>(CStoreReadStream& aStream, TUint8& aVal);
93 CStoreReadStream& operator>>(CStoreReadStream& aStream, TInt16& aVal);
94 CStoreReadStream& operator>>(CStoreReadStream& aStream, TUint16& aVal);
95 CStoreReadStream& operator>>(CStoreReadStream& aStream, TInt32& aVal);
96 CStoreReadStream& operator>>(CStoreReadStream& aStream, TUint32& aVal);
97 CStoreReadStream& operator>>(CStoreReadStream& aStream, TInt64& aVal);
98 CStoreReadStream& operator>>(CStoreReadStream& aStream, TUint64& aVal);
99 CStoreReadStream& operator>>(CStoreReadStream& aStream, TReal32& aVal);
100 CStoreReadStream& operator>>(CStoreReadStream& aStream, TReal64& aVal);
101 CStoreReadStream& operator>>(CStoreReadStream& aStream, CDes8& aDes);
102 CStoreReadStream& operator>>(CStoreReadStream& aStream, CDes16& aDes);
103 CStoreReadStream& operator>>(CStoreReadStream& aStream, TUid& aUid);
105 #endif // !defined(__STOREREADSTREAM_H__)