diff -r 000000000000 -r d0791faffa3f backupandrestore/backupengine/inc/sbebufferhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backupandrestore/backupengine/inc/sbebufferhandler.h Tue Feb 02 01:11:40 2010 +0200 @@ -0,0 +1,291 @@ +/** +* Copyright (c) 2004-2009 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: +* Declaration of Classes used to handle buffers +* +* +*/ + + + +/** + @file +*/ +#ifndef __SBEBUFFERHANDLER_H__ +#define __SBEBUFFERHANDLER_H__ + +#include +#include +#include +#include + +namespace conn + { + + const TInt KDesCArrayGranularity = 8; + + /** + This class defines the interface required to validate backup/restore data + + @internalTechnology + */ + class MValidationHandler + { + public: + /** + This method will check if the file name is in the + list of the files to be restored/backuped up + + @param aFileName reference to the filename to check + @return ETrue if file to backup/restore is valid + */ + virtual TBool ValidFileL(const TDesC& aFileName) = 0; + }; + + /** Temporary path used for restoring midlets + @internalTechnology + */ + _LIT(KMIDletTempRestorePath, "C:\\system\\temp\\MIDletRestore\\"); + + + /* Reads a fixed size object from a buffer + @internalTechnology + */ + template + TBool ReadFromBufferF(T& aT, TUint8*& appCurrent, const TUint8* apEnd); + + /* Reads a vairable size object from a buffer + @internalTechnology + */ + TBool ReadFromBufferV(TPtr8& aT, TInt aSize, TUint8*& appCurrent, + const TUint8* apEnd); + + /** Simple class to wrap up the fixed elements for a snapshot. + @internalTechnology + */ + class TSnapshot + { + public: + TSnapshot() + /** Standard C++ Constructor. + */ + { + } + TSnapshot(const TDesC& aFileName, TInt64 aModified) : + iFileName(aFileName), iModified(aModified) + /** Standard C++ Constructor. + @param aFileName name of file + @param aModified modification attribute of file + */ + { + } + public: + TFileName iFileName; /* RSnapshots; + + /** Simple class to wrap up the fixed elements for a file. + + @internalComponent + */ + class TFileFixedHeader + { + public: + TFileFixedHeader() + /** Standard C++ constructor + */ + { + } + + + TFileFixedHeader(const TUint aFileNameLength, TUint aFileSize, + TUint aAttributes, TInt64 aModified) : + iFileNameLength(aFileNameLength), iFileSize(aFileSize), iAttributes(aAttributes), iModified(aModified) + /** Standard C++ constructor + */ + { + } + public: + TUint iFileNameLength; /* offset into array */ + TInt iOffset; /*