|
1 // Copyright (c) 1998-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 #include "U32STD.H" |
|
17 #include "U32FRAME.H" |
|
18 |
|
19 const TInt KShiftCardinality8=1; |
|
20 const TInt KShiftCardinality16=2; |
|
21 const TInt KShiftCardinality32=3; |
|
22 // |
|
23 const TInt KDefaultIoBufSize=0xc00; |
|
24 const TInt KFilterIoBufSize=0x100; |
|
25 // |
|
26 NONSHARABLE_CLASS(TNullInput) : public MStreamInput |
|
27 { |
|
28 public: |
|
29 TInt PushL(const TAny* aPtr,TInt aMaxLength); |
|
30 TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); |
|
31 }; |
|
32 // |
|
33 NONSHARABLE_CLASS(TSourceOutput) : public MStreamOutput |
|
34 { |
|
35 public: |
|
36 inline TSourceOutput(MStreamBuf* aSource); |
|
37 // |
|
38 TInt PullL(TAny* aPtr,TInt aMaxLength); |
|
39 TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer); |
|
40 private: |
|
41 MStreamBuf* iSrc; |
|
42 }; |
|
43 // |
|
44 NONSHARABLE_CLASS(TFilterInput) : public MStreamInput |
|
45 { |
|
46 public: |
|
47 inline TFilterInput(TStreamFilter& aFilter,TAny* aPtr,TInt aMaxLength); |
|
48 inline TBool Done() const; |
|
49 inline TBool Eof() const; |
|
50 inline TInt Left() const; |
|
51 // |
|
52 TInt PushL(const TAny* aPtr,TInt aMaxLength); |
|
53 TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); |
|
54 private: |
|
55 TStreamFilter* iFltr; |
|
56 TUint8* iPtr; |
|
57 TInt iLeft; |
|
58 }; |
|
59 NONSHARABLE_CLASS(TFilterOutput) : public MStreamOutput |
|
60 { |
|
61 public: |
|
62 inline TFilterOutput(TStreamFilter& aFilter,const TAny* aPtr,TInt aLength); |
|
63 inline TBool Done() const; |
|
64 // |
|
65 TInt PullL(TAny* aPtr,TInt aMaxLength); |
|
66 TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer); |
|
67 private: |
|
68 TStreamFilter* iFltr; |
|
69 const TUint8* iFrom; |
|
70 const TUint8* iEnd; |
|
71 }; |
|
72 // |
|
73 NONSHARABLE_CLASS(TDelimitedInput8) : public MStreamInput |
|
74 { |
|
75 public: |
|
76 TDelimitedInput8(TUint8* aPtr,TInt aLength,TChar aDelim); |
|
77 inline TUint8* Ptr() const; |
|
78 inline TInt Done() const; |
|
79 // |
|
80 TInt PushL(const TAny* aPtr,TInt aMaxLength); |
|
81 TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); |
|
82 private: |
|
83 TUint8* iPtr; |
|
84 TInt iLeft; |
|
85 TChar iDelim; |
|
86 }; |
|
87 NONSHARABLE_CLASS(TDelimitedInput16) : public MStreamInput |
|
88 { |
|
89 public: |
|
90 TDelimitedInput16(TUint16* aPtr,TInt aLength,TChar aDelim); |
|
91 inline TUint16* Ptr() const; |
|
92 inline TInt Done() const; |
|
93 // |
|
94 TInt PushL(const TAny* aPtr,TInt aMaxLength); |
|
95 TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); |
|
96 private: |
|
97 TUint16* iPtr; |
|
98 TInt iLeft; |
|
99 TChar iDelim; |
|
100 }; |
|
101 // |
|
102 enum TStreamPanic |
|
103 { |
|
104 EStreamNotOpen, |
|
105 EStreamReadLengthNegative, |
|
106 EStreamReadBeyondEnd, |
|
107 EStreamReadNoTransfer, |
|
108 EStreamReadInBreach, |
|
109 EStreamWriteLengthNegative, |
|
110 EStreamWriteBeyondEnd, |
|
111 EStreamWriteNoTransfer, |
|
112 EStreamWriteInBreach, |
|
113 EStreamDoesNotUnderstand, |
|
114 EStreamCannotRead, |
|
115 EStreamCannotWrite, |
|
116 EStreamCannotSeek, |
|
117 EStreamTransferNegative, |
|
118 EStreamPosInvalid, |
|
119 EStreamMarkInvalid, |
|
120 EStreamLocationInvalid, |
|
121 EStreamAreaInvalid, |
|
122 EStreamModeInvalid, |
|
123 EStreamUnderflowInBreach, |
|
124 EStreamOverflowInBreach, |
|
125 EStreamFilterInBreach, |
|
126 EStreamPushLengthNegative, |
|
127 EStreamPushNoTransfer, |
|
128 EStreamPushInBreach, |
|
129 EStreamPullLengthNegative, |
|
130 EStreamPullNoTransfer, |
|
131 EStreamPullInBreach, |
|
132 EStreamCardinalityOutOfRange, |
|
133 EStreamOffsetNegative, |
|
134 EStreamExtentNegative, |
|
135 EStreamTypeInvalid, |
|
136 EStreamCommitted |
|
137 }; |
|
138 |
|
139 GLREF_C void Panic(TStreamPanic aPanic); |
|
140 |
|
141 #include "US_STD.INL" |
|
142 |