0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
/********************************************************************************
|
|
21 |
*
|
|
22 |
* CDataSupplierMemory
|
|
23 |
*
|
|
24 |
********************************************************************************/
|
|
25 |
#ifndef __CDATASUPPLIERMEMORY_H__
|
|
26 |
#define __CDATASUPPLIERMEMORY_H__
|
|
27 |
|
|
28 |
/*************************************************************************
|
|
29 |
*
|
|
30 |
* System Includes
|
|
31 |
*
|
|
32 |
*************************************************************************/
|
|
33 |
|
|
34 |
#include <e32std.h>
|
|
35 |
#include <e32base.h>
|
|
36 |
|
|
37 |
/********************************************************************************
|
|
38 |
*
|
|
39 |
* Local Includes
|
|
40 |
*
|
|
41 |
********************************************************************************/
|
|
42 |
|
|
43 |
#include "stat_interfaces.h"
|
|
44 |
|
|
45 |
/********************************************************************************
|
|
46 |
*
|
|
47 |
* Types
|
|
48 |
*
|
|
49 |
********************************************************************************/
|
|
50 |
class CDataSupplierMemory : public CBase, public MDataSupplier
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
// Construction and destruction
|
|
54 |
static CDataSupplierMemory *NewL( void );
|
|
55 |
|
|
56 |
// from MDataSupplier
|
|
57 |
void Delete( void );
|
|
58 |
TInt GetTotalSize( TInt &aTotalSize );
|
|
59 |
TInt GetRemainingSize( TInt &aRemainingSize );
|
|
60 |
|
|
61 |
// The data source is a buffer of memory which is
|
|
62 |
// copied to this object.
|
|
63 |
TInt SetData( const TDesC8 &aSource );
|
|
64 |
TInt GetData( HBufC8 &aDestination,
|
|
65 |
TInt aLengthToCopy, TInt &aActuallyCopied );
|
|
66 |
// TInt GetDataPtr( TPtrC8 &aDestination );
|
|
67 |
|
|
68 |
private:
|
|
69 |
CDataSupplierMemory( void );
|
|
70 |
virtual ~CDataSupplierMemory();
|
|
71 |
void ConstructL( void );
|
|
72 |
|
|
73 |
HBufC8 *iDataBuffer;
|
|
74 |
TInt iCurrentLocation;
|
|
75 |
|
|
76 |
RMutex iLock;
|
|
77 |
};
|
|
78 |
|
|
79 |
#endif // __CDATASUPPLIERMEMORY_H__
|