cryptoservices/filebasedcertificateandkeystores/source/generic/server/fstokenutil.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2004-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 
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @internalTechnology
       
    24 */
       
    25  
       
    26 #ifndef __FSTOKENUTIL_H__
       
    27 #define __FSTOKENUTIL_H__
       
    28 
       
    29 #include "tokentypesenum.h"
       
    30 #include <fstokencliserv.h>
       
    31 
       
    32 /// Panic the client
       
    33 void PanicClient(const RMessage2& aMessage, ETokenTypeServerPanic aPanic);
       
    34 /// Panic the server
       
    35 void PanicServer(ETokenTypeServerPanic aPanicCode);
       
    36 /// Assert macro
       
    37 #define assert(TEST, PANIC) __ASSERT_ALWAYS(TEST, PanicServer(PANIC))
       
    38 
       
    39 class RFs;
       
    40 
       
    41 /// Length of filename buffer for store path
       
    42 const TUint KMaxFilenameLength = 40;
       
    43 
       
    44 /**
       
    45  * Files utilities used by all servers. 
       
    46  */
       
    47 struct FileUtils
       
    48 	{
       
    49 	/// Determine whether a file exists
       
    50 	static TBool ExistsL(RFs& aFs, const TDesC& aFile);
       
    51 	/// Ensure all directories in a file's path exist, creating them if not
       
    52 	static void EnsurePathL(RFs& aFs, const TDesC& aFile);
       
    53 	/// Copy a file from one location to another
       
    54 	static void CopyL(RFs& aFs, const TDesC& aSouce, const TDesC& aDest);
       
    55 	/// Construct a filename in the server's private area
       
    56 	static void MakePrivateFilenameL(RFs& aFs, const TDesC& aLeafName, TDes& aNameOut);
       
    57 	/// Construct a filename in the server's private area in ROM
       
    58 	static void MakePrivateROMFilenameL(RFs& aFs, const TDesC& aLeafName, TDes& aNameOut);
       
    59 	};
       
    60 
       
    61 #endif	//	__FSTOKENUTIL_H__