testconns/statapi/device/source/statapi/inc/datasupplier_file.h
changeset 4 b8d1455fddc0
equal deleted inserted replaced
2:73b88125830c 4:b8d1455fddc0
       
     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  * CDataSupplierFile
       
    23  *
       
    24  ********************************************************************************/
       
    25 #ifndef __CDATASUPPLIERFILE_H__
       
    26 #define __CDATASUPPLIERFILE_H__
       
    27 
       
    28  /*************************************************************************
       
    29  *
       
    30  * System Includes
       
    31  *
       
    32  *************************************************************************/
       
    33 
       
    34 #include <e32std.h>
       
    35 #include <e32base.h>
       
    36 #include <f32file.h>
       
    37 
       
    38 /********************************************************************************
       
    39  *
       
    40  * Local Includes
       
    41  *
       
    42  ********************************************************************************/
       
    43 
       
    44 #include "stat_interfaces.h"
       
    45 
       
    46 /********************************************************************************
       
    47  *
       
    48  * Types
       
    49  *
       
    50  ********************************************************************************/
       
    51 class CDataSupplierFile :  public CBase, public MDataSupplier
       
    52 {
       
    53 public:
       
    54 	// Construction and destruction
       
    55 	static CDataSupplierFile *NewL( void );
       
    56 
       
    57 	// from MDataSupplier
       
    58 	void	Delete( void );
       
    59 	TInt	GetTotalSize( TInt &aTotalSize );
       
    60 	TInt	GetRemainingSize( TInt &aRemainingSize );
       
    61 
       
    62 	// The data source is a string representing a file path.
       
    63 	TInt 	SetData( const TDesC8 &aSource );
       
    64 	TInt	GetData( HBufC8 &aDestination,
       
    65 				TInt aLengthToCopy, TInt &aActuallyCopied );
       
    66 
       
    67 private:
       
    68 	CDataSupplierFile( void );
       
    69 	virtual ~CDataSupplierFile();
       
    70 	void ConstructL( void );
       
    71 
       
    72 	HBufC8	*iDataBuffer;
       
    73 	TInt	iCurrentLocation;
       
    74 
       
    75 	TPath	iFilePath;
       
    76 	RFs		iFsSession;
       
    77 
       
    78 	RMutex	iLock;
       
    79 };
       
    80 
       
    81 #endif // __CDATASUPPLIERFILE_H__