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(__EXBUF_H__) williamr@2: #define __EXBUF_H__ williamr@2: williamr@2: williamr@2: williamr@2: class CExportBufferBase : public CBase williamr@2: /** williamr@2: CExportBufferBase williamr@2: @publishedPartner williamr@2: @deprecated williamr@2: */ williamr@2: { williamr@2: // The purpose of this class is to provide a method of williamr@2: // abstracting the destination of an output through a buffer williamr@2: // The class is intended to be used for a single output then destroyed williamr@2: public: williamr@2: IMPORT_C CExportBufferBase(TInt aMaxSize); williamr@2: IMPORT_C ~CExportBufferBase(); williamr@2: IMPORT_C void ConstructL(); williamr@2: virtual void CommitExportBufferL()=0; williamr@2: IMPORT_C void ResetExportBuffer(); williamr@2: IMPORT_C void ResetWritePtr(); williamr@2: IMPORT_C void FinalizeExport(); williamr@2: IMPORT_C void InsertL(TText aText); // !! TText should be TText8 - do I need an overload here for Unicode? williamr@2: protected: williamr@2: TInt iExportBufferLength; williamr@2: HBufC* iExportBuffer; williamr@2: private: williamr@2: TText* iWritePtr; williamr@2: TText* iTBase; williamr@2: TInt iMaxSize; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: class CExportDynamicBuffer : public CExportBufferBase williamr@2: /** williamr@2: CExportDynamicBuffer williamr@2: @publishedPartner williamr@2: @deprecated williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CExportDynamicBuffer* NewL(TInt aSize, CBufBase& aDynamicBuffer); williamr@2: IMPORT_C void ConstructL(); williamr@2: public: // from CExportBufferBase williamr@2: IMPORT_C void CommitExportBufferL(); williamr@2: private: williamr@2: CExportDynamicBuffer(TInt aSize, CBufBase& aDynamicBuffer); williamr@2: private: williamr@2: CBufBase& iOutput; williamr@2: }; williamr@2: williamr@2: #endif // __EXBUF_H__