baseapitest/basesvs/common/inc/FileserverUtil.h
changeset 0 a41df078684a
child 15 4122176ea935
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     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 the License "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 #if (!defined __FILESERVERUTIL_H__)
       
    20 #define __FILESERVERUTIL_H__
       
    21 
       
    22 
       
    23 //	EPOC Includes
       
    24 #include <test/datawrapper.h>
       
    25 
       
    26 /** 
       
    27 @publishedAll
       
    28 @released
       
    29 
       
    30 Template class CleanupResetAndDestroy to clean up the array
       
    31 of implementation information from the cleanup stack.
       
    32 */
       
    33 
       
    34 template <class T>
       
    35 class CleanupResetAndDestroy
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	Puts an item on the cleanup stack.
       
    40 
       
    41 	@param  aRef 
       
    42 	        The implementation information to be put on the cleanup stack.
       
    43 	*/
       
    44 	inline static void PushL(T& aRef);
       
    45 private:
       
    46 	static void ResetAndDestroy(TAny *aPtr);
       
    47 	};
       
    48 template <class T>
       
    49 inline void CleanupResetAndDestroyPushL(T& aRef);
       
    50 template <class T>
       
    51 inline void CleanupResetAndDestroy<T>::PushL(T& aRef)
       
    52 	{CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef));}
       
    53 template <class T>
       
    54 void CleanupResetAndDestroy<T>::ResetAndDestroy(TAny *aPtr)
       
    55 	{(STATIC_CAST(T*,aPtr))->ResetAndDestroy();}
       
    56 template <class T>
       
    57 inline void CleanupResetAndDestroyPushL(T& aRef)
       
    58 	{CleanupResetAndDestroy<T>::PushL(aRef);}
       
    59 
       
    60 class FileserverUtil
       
    61 	{
       
    62 public:
       
    63 
       
    64 	static TBool 		GetAttMask(CDataWrapper& aDataWrapper, const TDesC& aSection, const TDesC& aParameterName, TUint& aAttMask);
       
    65 	static TBool		VerifyTEntryDataFromIniL(CDataWrapper& aDataWrapper, const TDesC& aSection, TEntry& aEntry);
       
    66 	static TBool		VerifyTVolumeInfoDataFromIniL(CDataWrapper& aDataWrapper, const TDesC& aSection, TVolumeInfo& aVolumeInfo);
       
    67 	
       
    68 private:
       
    69 	static TBool 		ConvertToAttMask(const TDesC& aAttMaskStr, TUint& aAttMask);
       
    70 	};
       
    71 
       
    72 #endif /* __FILESERVERUTIL_H__ */