williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #if !defined(__INBUF_H__) williamr@2: #define __INBUF_H__ williamr@2: williamr@2: #if !defined(__F32FILE_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__S32STOR_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: const TInt KErrEndOfInput = -1000; williamr@2: williamr@2: williamr@2: class CImportBufferBase : public CBase williamr@2: /** williamr@2: The purpose of this class is to provide a method of williamr@2: abstracting the source of an input through a buffer williamr@2: The class is intended to be used for a single input then destroyed williamr@2: @publishedPartner williamr@2: @deprecated> williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C CImportBufferBase(TInt aMaxSize); williamr@2: IMPORT_C ~CImportBufferBase(); williamr@2: IMPORT_C void ConstructL(); williamr@2: IMPORT_C TInt ReadL(TText8& aByte); williamr@2: // !! Descriptor versions of ReadL useful? williamr@2: IMPORT_C virtual TInt SeekL(TSeek aSeekMode, TInt anOffset); williamr@2: IMPORT_C void ResetImportBuffer(); williamr@2: IMPORT_C void ResetReadPtr(); williamr@2: protected: williamr@2: virtual TInt FillImportBuf()=0; williamr@2: IMPORT_C TInt MaxSize(); williamr@2: IMPORT_C void SetLength(TInt aLength); williamr@2: protected: williamr@2: TInt iImportBufferLength; williamr@2: HBufC8* iImportBuffer; williamr@2: private: williamr@2: TText8* iReadPtr; williamr@2: TText8* iEndBuf; williamr@2: TText8* iTBase; williamr@2: TInt iMaxSize; williamr@2: }; williamr@2: williamr@2: williamr@2: class CFileImportBuffer : public CImportBufferBase williamr@2: /** williamr@2: Buffered import from a file williamr@2: @publishedPartner williamr@2: @deprecated williamr@2: */ williamr@2: { williamr@2: // Buffered import from a file williamr@2: public: williamr@2: IMPORT_C CFileImportBuffer(RFile aSource, TInt aMaxSize); williamr@2: IMPORT_C TInt SeekL(TSeek aSeekMode, TInt anOffset); williamr@2: protected: williamr@2: IMPORT_C TInt FillImportBuf(); williamr@2: private: williamr@2: RFile iSource; williamr@2: }; williamr@2: williamr@2: #endif // __INBUF_H__