os/kernelhwsrv/baseapitest/basesvs/common/inc/FileserverUtil.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/baseapitest/basesvs/common/inc/FileserverUtil.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,73 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +#if (!defined __FILESERVERUTIL_H__)
    1.24 +#define __FILESERVERUTIL_H__
    1.25 +
    1.26 +
    1.27 +//	EPOC Includes
    1.28 +#include <test/datawrapper.h>
    1.29 +
    1.30 +/** 
    1.31 +@publishedAll
    1.32 +@released
    1.33 +
    1.34 +Template class CleanupResetAndDestroy to clean up the array
    1.35 +of implementation information from the cleanup stack.
    1.36 +*/
    1.37 +
    1.38 +template <class T>
    1.39 +class CleanupResetAndDestroy
    1.40 +	{
    1.41 +public:
    1.42 +	/**
    1.43 +	Puts an item on the cleanup stack.
    1.44 +
    1.45 +	@param  aRef 
    1.46 +	        The implementation information to be put on the cleanup stack.
    1.47 +	*/
    1.48 +	inline static void PushL(T& aRef);
    1.49 +private:
    1.50 +	static void ResetAndDestroy(TAny *aPtr);
    1.51 +	};
    1.52 +template <class T>
    1.53 +inline void CleanupResetAndDestroyPushL(T& aRef);
    1.54 +template <class T>
    1.55 +inline void CleanupResetAndDestroy<T>::PushL(T& aRef)
    1.56 +	{CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef));}
    1.57 +template <class T>
    1.58 +void CleanupResetAndDestroy<T>::ResetAndDestroy(TAny *aPtr)
    1.59 +	{(STATIC_CAST(T*,aPtr))->ResetAndDestroy();}
    1.60 +template <class T>
    1.61 +inline void CleanupResetAndDestroyPushL(T& aRef)
    1.62 +	{CleanupResetAndDestroy<T>::PushL(aRef);}
    1.63 +
    1.64 +class FileserverUtil
    1.65 +	{
    1.66 +public:
    1.67 +
    1.68 +	static TBool 		GetAttMask(CDataWrapper& aDataWrapper, const TDesC& aSection, const TDesC& aParameterName, TUint& aAttMask);
    1.69 +	static TBool		VerifyTEntryDataFromIniL(CDataWrapper& aDataWrapper, const TDesC& aSection, TEntry& aEntry);
    1.70 +	static TBool		VerifyTVolumeInfoDataFromIniL(CDataWrapper& aDataWrapper, const TDesC& aSection, TVolumeInfo& aVolumeInfo);
    1.71 +	
    1.72 +private:
    1.73 +	static TBool 		ConvertToAttMask(const TDesC& aAttMaskStr, TUint& aAttMask);
    1.74 +	};
    1.75 +
    1.76 +#endif /* __FILESERVERUTIL_H__ */