sl@0
|
1 |
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "U32STD.H"
|
sl@0
|
17 |
#include "U32FRAME.H"
|
sl@0
|
18 |
|
sl@0
|
19 |
const TInt KShiftCardinality8=1;
|
sl@0
|
20 |
const TInt KShiftCardinality16=2;
|
sl@0
|
21 |
const TInt KShiftCardinality32=3;
|
sl@0
|
22 |
//
|
sl@0
|
23 |
const TInt KDefaultIoBufSize=0xc00;
|
sl@0
|
24 |
const TInt KFilterIoBufSize=0x100;
|
sl@0
|
25 |
//
|
sl@0
|
26 |
NONSHARABLE_CLASS(TNullInput) : public MStreamInput
|
sl@0
|
27 |
{
|
sl@0
|
28 |
public:
|
sl@0
|
29 |
TInt PushL(const TAny* aPtr,TInt aMaxLength);
|
sl@0
|
30 |
TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer);
|
sl@0
|
31 |
};
|
sl@0
|
32 |
//
|
sl@0
|
33 |
NONSHARABLE_CLASS(TSourceOutput) : public MStreamOutput
|
sl@0
|
34 |
{
|
sl@0
|
35 |
public:
|
sl@0
|
36 |
inline TSourceOutput(MStreamBuf* aSource);
|
sl@0
|
37 |
//
|
sl@0
|
38 |
TInt PullL(TAny* aPtr,TInt aMaxLength);
|
sl@0
|
39 |
TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer);
|
sl@0
|
40 |
private:
|
sl@0
|
41 |
MStreamBuf* iSrc;
|
sl@0
|
42 |
};
|
sl@0
|
43 |
//
|
sl@0
|
44 |
NONSHARABLE_CLASS(TFilterInput) : public MStreamInput
|
sl@0
|
45 |
{
|
sl@0
|
46 |
public:
|
sl@0
|
47 |
inline TFilterInput(TStreamFilter& aFilter,TAny* aPtr,TInt aMaxLength);
|
sl@0
|
48 |
inline TBool Done() const;
|
sl@0
|
49 |
inline TBool Eof() const;
|
sl@0
|
50 |
inline TInt Left() const;
|
sl@0
|
51 |
//
|
sl@0
|
52 |
TInt PushL(const TAny* aPtr,TInt aMaxLength);
|
sl@0
|
53 |
TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer);
|
sl@0
|
54 |
private:
|
sl@0
|
55 |
TStreamFilter* iFltr;
|
sl@0
|
56 |
TUint8* iPtr;
|
sl@0
|
57 |
TInt iLeft;
|
sl@0
|
58 |
};
|
sl@0
|
59 |
NONSHARABLE_CLASS(TFilterOutput) : public MStreamOutput
|
sl@0
|
60 |
{
|
sl@0
|
61 |
public:
|
sl@0
|
62 |
inline TFilterOutput(TStreamFilter& aFilter,const TAny* aPtr,TInt aLength);
|
sl@0
|
63 |
inline TBool Done() const;
|
sl@0
|
64 |
//
|
sl@0
|
65 |
TInt PullL(TAny* aPtr,TInt aMaxLength);
|
sl@0
|
66 |
TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer);
|
sl@0
|
67 |
private:
|
sl@0
|
68 |
TStreamFilter* iFltr;
|
sl@0
|
69 |
const TUint8* iFrom;
|
sl@0
|
70 |
const TUint8* iEnd;
|
sl@0
|
71 |
};
|
sl@0
|
72 |
//
|
sl@0
|
73 |
NONSHARABLE_CLASS(TDelimitedInput8) : public MStreamInput
|
sl@0
|
74 |
{
|
sl@0
|
75 |
public:
|
sl@0
|
76 |
TDelimitedInput8(TUint8* aPtr,TInt aLength,TChar aDelim);
|
sl@0
|
77 |
inline TUint8* Ptr() const;
|
sl@0
|
78 |
inline TInt Done() const;
|
sl@0
|
79 |
//
|
sl@0
|
80 |
TInt PushL(const TAny* aPtr,TInt aMaxLength);
|
sl@0
|
81 |
TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer);
|
sl@0
|
82 |
private:
|
sl@0
|
83 |
TUint8* iPtr;
|
sl@0
|
84 |
TInt iLeft;
|
sl@0
|
85 |
TChar iDelim;
|
sl@0
|
86 |
};
|
sl@0
|
87 |
NONSHARABLE_CLASS(TDelimitedInput16) : public MStreamInput
|
sl@0
|
88 |
{
|
sl@0
|
89 |
public:
|
sl@0
|
90 |
TDelimitedInput16(TUint16* aPtr,TInt aLength,TChar aDelim);
|
sl@0
|
91 |
inline TUint16* Ptr() const;
|
sl@0
|
92 |
inline TInt Done() const;
|
sl@0
|
93 |
//
|
sl@0
|
94 |
TInt PushL(const TAny* aPtr,TInt aMaxLength);
|
sl@0
|
95 |
TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer);
|
sl@0
|
96 |
private:
|
sl@0
|
97 |
TUint16* iPtr;
|
sl@0
|
98 |
TInt iLeft;
|
sl@0
|
99 |
TChar iDelim;
|
sl@0
|
100 |
};
|
sl@0
|
101 |
//
|
sl@0
|
102 |
enum TStreamPanic
|
sl@0
|
103 |
{
|
sl@0
|
104 |
EStreamNotOpen,
|
sl@0
|
105 |
EStreamReadLengthNegative,
|
sl@0
|
106 |
EStreamReadBeyondEnd,
|
sl@0
|
107 |
EStreamReadNoTransfer,
|
sl@0
|
108 |
EStreamReadInBreach,
|
sl@0
|
109 |
EStreamWriteLengthNegative,
|
sl@0
|
110 |
EStreamWriteBeyondEnd,
|
sl@0
|
111 |
EStreamWriteNoTransfer,
|
sl@0
|
112 |
EStreamWriteInBreach,
|
sl@0
|
113 |
EStreamDoesNotUnderstand,
|
sl@0
|
114 |
EStreamCannotRead,
|
sl@0
|
115 |
EStreamCannotWrite,
|
sl@0
|
116 |
EStreamCannotSeek,
|
sl@0
|
117 |
EStreamTransferNegative,
|
sl@0
|
118 |
EStreamPosInvalid,
|
sl@0
|
119 |
EStreamMarkInvalid,
|
sl@0
|
120 |
EStreamLocationInvalid,
|
sl@0
|
121 |
EStreamAreaInvalid,
|
sl@0
|
122 |
EStreamModeInvalid,
|
sl@0
|
123 |
EStreamUnderflowInBreach,
|
sl@0
|
124 |
EStreamOverflowInBreach,
|
sl@0
|
125 |
EStreamFilterInBreach,
|
sl@0
|
126 |
EStreamPushLengthNegative,
|
sl@0
|
127 |
EStreamPushNoTransfer,
|
sl@0
|
128 |
EStreamPushInBreach,
|
sl@0
|
129 |
EStreamPullLengthNegative,
|
sl@0
|
130 |
EStreamPullNoTransfer,
|
sl@0
|
131 |
EStreamPullInBreach,
|
sl@0
|
132 |
EStreamCardinalityOutOfRange,
|
sl@0
|
133 |
EStreamOffsetNegative,
|
sl@0
|
134 |
EStreamExtentNegative,
|
sl@0
|
135 |
EStreamTypeInvalid,
|
sl@0
|
136 |
EStreamCommitted
|
sl@0
|
137 |
};
|
sl@0
|
138 |
|
sl@0
|
139 |
GLREF_C void Panic(TStreamPanic aPanic);
|
sl@0
|
140 |
|
sl@0
|
141 |
#include "US_STD.INL"
|
sl@0
|
142 |
|