|
1 // Copyright (c) 1997-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 #if !defined(__INBUF_H__) |
|
17 #define __INBUF_H__ |
|
18 |
|
19 #if !defined(__F32FILE_H__) |
|
20 #include <f32file.h> |
|
21 #endif |
|
22 |
|
23 #if !defined(__S32STOR_H__) |
|
24 #include <s32stor.h> |
|
25 #endif |
|
26 |
|
27 const TInt KErrEndOfInput = -1000; |
|
28 |
|
29 |
|
30 class CImportBufferBase : public CBase |
|
31 /** |
|
32 The purpose of this class is to provide a method of |
|
33 abstracting the source of an input through a buffer |
|
34 The class is intended to be used for a single input then destroyed |
|
35 @publishedPartner |
|
36 @deprecated> |
|
37 */ |
|
38 { |
|
39 public: |
|
40 IMPORT_C CImportBufferBase(TInt aMaxSize); |
|
41 IMPORT_C ~CImportBufferBase(); |
|
42 IMPORT_C void ConstructL(); |
|
43 IMPORT_C TInt ReadL(TText8& aByte); |
|
44 // !! Descriptor versions of ReadL useful? |
|
45 IMPORT_C virtual TInt SeekL(TSeek aSeekMode, TInt anOffset); |
|
46 IMPORT_C void ResetImportBuffer(); |
|
47 IMPORT_C void ResetReadPtr(); |
|
48 protected: |
|
49 virtual TInt FillImportBuf()=0; |
|
50 IMPORT_C TInt MaxSize(); |
|
51 IMPORT_C void SetLength(TInt aLength); |
|
52 protected: |
|
53 TInt iImportBufferLength; |
|
54 HBufC8* iImportBuffer; |
|
55 private: |
|
56 TText8* iReadPtr; |
|
57 TText8* iEndBuf; |
|
58 TText8* iTBase; |
|
59 TInt iMaxSize; |
|
60 }; |
|
61 |
|
62 |
|
63 class CFileImportBuffer : public CImportBufferBase |
|
64 /** |
|
65 Buffered import from a file |
|
66 @publishedPartner |
|
67 @deprecated |
|
68 */ |
|
69 { |
|
70 // Buffered import from a file |
|
71 public: |
|
72 IMPORT_C CFileImportBuffer(RFile aSource, TInt aMaxSize); |
|
73 IMPORT_C TInt SeekL(TSeek aSeekMode, TInt anOffset); |
|
74 protected: |
|
75 IMPORT_C TInt FillImportBuf(); |
|
76 private: |
|
77 RFile iSource; |
|
78 }; |
|
79 |
|
80 #endif // __INBUF_H__ |