PECengine/StorageManager2/Tools/PEngHashTool.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Hashing tool
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PENGHASHTOOL_H__
       
    20 #define __PENGHASHTOOL_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KDirDelimLength = 1;
       
    27 _LIT( KDirDelim, "\\" );
       
    28 
       
    29 
       
    30 /**
       
    31  * Hashing tool
       
    32  *
       
    33  * @since 3.0
       
    34  */
       
    35 class PEngHashTool
       
    36     {
       
    37     public:
       
    38         /**
       
    39          *  Hash given descriptor
       
    40          *
       
    41          *  @since 3.0
       
    42          *  @param  aDesToHash descriptor to hash
       
    43          *  @return hashed descriptor
       
    44          */
       
    45         static HBufC* HashDescriptorL( const TDesC& aDesToHash );
       
    46 
       
    47         /**
       
    48          *  Hash name of the state from the given
       
    49          *	user name and server address
       
    50          *
       
    51          *  @since 3.0
       
    52          *  @param
       
    53          *  @return
       
    54          */
       
    55         static HBufC* HashStateNameL( const TDesC& aServerAddress,
       
    56                                       const TDesC& aUserName );
       
    57 
       
    58     private:
       
    59         /**
       
    60          *  Replace forbidden characters in descriptor
       
    61          *
       
    62          *  @since 3.0
       
    63          *  @param descriptor
       
    64          *  @param aConvertFrom character to replace
       
    65          *  @param aConvertTo charatcter to replace with
       
    66          */
       
    67         static void ReplaceCharacterInDescriptor( TPtr& aDescriptor,
       
    68                                                   TText aConvertFrom,
       
    69                                                   TText aConvertTo );
       
    70     };
       
    71 
       
    72 #endif // __PENGHASHTOOL_H__
       
    73 //  End of File
       
    74