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