landmarks/locationlandmarks/clientlib/inc/epos_cposwritebufstorage.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 22:09:33 +0300
branchRCL_3
changeset 47 fce0ae2e4223
parent 0 667063e416a2
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  CPosWriteBufStorage class definition file
*
*/


#ifndef __EPOS_CPOSWRITEBUFSTORAGE_H_
#define __EPOS_CPOSWRITEBUFSTORAGE_H_

#include <e32base.h>

/**
 * Internal class, supports writing data elements to fixed-size buffer.
 */
NONSHARABLE_CLASS( CPosWriteBufStorage ) : public CBase
    {
    public:
        static CPosWriteBufStorage* NewLC( TInt aMaxLen );
        
        ~CPosWriteBufStorage();

    public:        
        static TInt PackedSize( const TDesC& aText );
        static TInt PackedSize( const TDesC8& aText );
        
        void Put( TInt aData );
        void Put( TUint32 aData );
        void Put( TUint16 aData );
        void Put( const TDesC16& aData );
        void Put( const TDesC8& aData );
        
        HBufC8* FinalizeL();

    protected:
        CPosWriteBufStorage();
        void Put( TUint8* aSrc, const TInt aSize );
            
    protected:
        HBufC8* iBuffer;
    };

#endif // __EPOS_CPOSWRITEBUFSTORAGE_H_