messagingfw/msgsrvnstore/server/inc/CCopyOneFile.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CCOPYONEFILE_H__
       
    17 #define __CCOPYONEFILE_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <f32file.h>
       
    21 
       
    22 class CCopyOneFile : public CActive
       
    23 /**
       
    24 @internalComponent
       
    25 @released
       
    26 */
       
    27 	{
       
    28 public:
       
    29 	static CCopyOneFile* NewL(RFs &aFs);
       
    30 
       
    31 	void Copy(const TFileName &aFrom, const TFileName &aTo,TRequestStatus& aStatus);
       
    32 
       
    33 	void Copy(RFile& aFrom, RFile& aTo, TRequestStatus& aStatus);
       
    34 	
       
    35 	~CCopyOneFile();
       
    36 private:
       
    37 	// From CActive;
       
    38 	void RunL();
       
    39 	void DoCancel();
       
    40 	TInt RunError(TInt aError);
       
    41 
       
    42 
       
    43 	void ConstructL();
       
    44 	CCopyOneFile(RFs &aFs);
       
    45 	void CopyABuffer();
       
    46 
       
    47 	void Complete(TInt aError);
       
    48 private:
       
    49 	// buffer allocated to copy the file, persists while the object persists
       
    50 	// KCopyFileBufferSize bytes in length
       
    51 	TDes8*	 iFileBuffer;
       
    52 	RFs		&iFs;
       
    53 	RFile	 iFrom;
       
    54 	RFile	 iTo;
       
    55 	// flag to tell RunL whether the last thing we did was read or write.
       
    56 	TBool    iReading;
       
    57 	TRequestStatus *iReportStatus;
       
    58 	};
       
    59 
       
    60 #endif // __CCOPYONEFILE_H__
       
    61