Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // Collection of common constants, utility functions, etc. for the file server and file systems.
16 // Definitions here must be filesystem-agnostic, i.e. generic enougs to be used by every file system
18 // This is the internal file and must not be exported.
25 #include "filesystem_utils.h"
27 //-----------------------------------------------------------------------------
30 Calculates the log2 of a number
32 @param aNum Number to calulate the log two of
33 @return The log two of the number passed in
35 TUint32 Log2(TUint32 aVal)
37 return Log2_inline(aVal);
40 //-----------------------------------------------------------------------------
42 Calculates number of '1' bits in the aVal
44 @param aVal some value
45 @return number of '1' bits in the aVal
47 TUint32 Count1Bits(TUint32 aVal)
49 return Count1Bits_inline(aVal);
52 //-----------------------------------------------------------------------------
54 Removes trailing dots from aName.
55 @return new string descriptor that may have its length adjusted
57 TPtrC RemoveTrailingDots(const TDesC& aName)
59 TInt len = aName.Length();
63 if(aName[len-1] == '.')
69 TPtrC ptrNoDots(aName.Ptr(), len);