sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "U32STD.H" sl@0: #include "U32FRAME.H" sl@0: sl@0: const TInt KShiftCardinality8=1; sl@0: const TInt KShiftCardinality16=2; sl@0: const TInt KShiftCardinality32=3; sl@0: // sl@0: const TInt KDefaultIoBufSize=0xc00; sl@0: const TInt KFilterIoBufSize=0x100; sl@0: // sl@0: NONSHARABLE_CLASS(TNullInput) : public MStreamInput sl@0: { sl@0: public: sl@0: TInt PushL(const TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); sl@0: }; sl@0: // sl@0: NONSHARABLE_CLASS(TSourceOutput) : public MStreamOutput sl@0: { sl@0: public: sl@0: inline TSourceOutput(MStreamBuf* aSource); sl@0: // sl@0: TInt PullL(TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer); sl@0: private: sl@0: MStreamBuf* iSrc; sl@0: }; sl@0: // sl@0: NONSHARABLE_CLASS(TFilterInput) : public MStreamInput sl@0: { sl@0: public: sl@0: inline TFilterInput(TStreamFilter& aFilter,TAny* aPtr,TInt aMaxLength); sl@0: inline TBool Done() const; sl@0: inline TBool Eof() const; sl@0: inline TInt Left() const; sl@0: // sl@0: TInt PushL(const TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); sl@0: private: sl@0: TStreamFilter* iFltr; sl@0: TUint8* iPtr; sl@0: TInt iLeft; sl@0: }; sl@0: NONSHARABLE_CLASS(TFilterOutput) : public MStreamOutput sl@0: { sl@0: public: sl@0: inline TFilterOutput(TStreamFilter& aFilter,const TAny* aPtr,TInt aLength); sl@0: inline TBool Done() const; sl@0: // sl@0: TInt PullL(TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer WriteToL(MStreamBuf& aSink,TStreamTransfer aTransfer); sl@0: private: sl@0: TStreamFilter* iFltr; sl@0: const TUint8* iFrom; sl@0: const TUint8* iEnd; sl@0: }; sl@0: // sl@0: NONSHARABLE_CLASS(TDelimitedInput8) : public MStreamInput sl@0: { sl@0: public: sl@0: TDelimitedInput8(TUint8* aPtr,TInt aLength,TChar aDelim); sl@0: inline TUint8* Ptr() const; sl@0: inline TInt Done() const; sl@0: // sl@0: TInt PushL(const TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); sl@0: private: sl@0: TUint8* iPtr; sl@0: TInt iLeft; sl@0: TChar iDelim; sl@0: }; sl@0: NONSHARABLE_CLASS(TDelimitedInput16) : public MStreamInput sl@0: { sl@0: public: sl@0: TDelimitedInput16(TUint16* aPtr,TInt aLength,TChar aDelim); sl@0: inline TUint16* Ptr() const; sl@0: inline TInt Done() const; sl@0: // sl@0: TInt PushL(const TAny* aPtr,TInt aMaxLength); sl@0: TStreamTransfer ReadFromL(MStreamBuf& aSource,TStreamTransfer aTransfer); sl@0: private: sl@0: TUint16* iPtr; sl@0: TInt iLeft; sl@0: TChar iDelim; sl@0: }; sl@0: // sl@0: enum TStreamPanic sl@0: { sl@0: EStreamNotOpen, sl@0: EStreamReadLengthNegative, sl@0: EStreamReadBeyondEnd, sl@0: EStreamReadNoTransfer, sl@0: EStreamReadInBreach, sl@0: EStreamWriteLengthNegative, sl@0: EStreamWriteBeyondEnd, sl@0: EStreamWriteNoTransfer, sl@0: EStreamWriteInBreach, sl@0: EStreamDoesNotUnderstand, sl@0: EStreamCannotRead, sl@0: EStreamCannotWrite, sl@0: EStreamCannotSeek, sl@0: EStreamTransferNegative, sl@0: EStreamPosInvalid, sl@0: EStreamMarkInvalid, sl@0: EStreamLocationInvalid, sl@0: EStreamAreaInvalid, sl@0: EStreamModeInvalid, sl@0: EStreamUnderflowInBreach, sl@0: EStreamOverflowInBreach, sl@0: EStreamFilterInBreach, sl@0: EStreamPushLengthNegative, sl@0: EStreamPushNoTransfer, sl@0: EStreamPushInBreach, sl@0: EStreamPullLengthNegative, sl@0: EStreamPullNoTransfer, sl@0: EStreamPullInBreach, sl@0: EStreamCardinalityOutOfRange, sl@0: EStreamOffsetNegative, sl@0: EStreamExtentNegative, sl@0: EStreamTypeInvalid, sl@0: EStreamCommitted sl@0: }; sl@0: sl@0: GLREF_C void Panic(TStreamPanic aPanic); sl@0: sl@0: #include "US_STD.INL" sl@0: