|
1 /* |
|
2 * Copyright (c) 2007-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 @file STRINGUTILS.H |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 #ifndef STRINGUTILS_H |
|
25 #define STRINGUTILS_H |
|
26 |
|
27 // System includes |
|
28 #include <istream> |
|
29 #include <list> |
|
30 #include <vector> |
|
31 #include <map> |
|
32 #include <string> |
|
33 |
|
34 // User includes |
|
35 #include "symbiantypes.h" |
|
36 |
|
37 // Constants |
|
38 const std::wstring KDirectorySeparator( L"\\" ); |
|
39 |
|
40 class StringUtils |
|
41 { |
|
42 public: |
|
43 static int FirstInvalidDirSeparatorSize(std::wstring& aPath, std::wstring::size_type& aIndex); |
|
44 static std::wstring FixPathDelimiters( const std::string& aString ); |
|
45 static std::string TrimWhiteSpace( const std::string& aString ); |
|
46 static bool CheckForMatch( const std::string& aSearchFor, std::string& aLine ); |
|
47 static std::string ToUpper( const std::string& aString ); |
|
48 static std::wstring ToUpper( const std::wstring& aString ); |
|
49 static std::string ToLower( const std::string& aString ); |
|
50 static bool IsLastCharacter( const std::wstring& aString, wchar_t aChar ); |
|
51 static bool StartsWithDrive( const std::wstring& aText ); |
|
52 static std::wstring MakePathFromSID( const std::wstring& aBasePath, TUint32 aSID ); |
|
53 static std::wstring BuildSisRegistryFileName( const int aIndex ); |
|
54 static std::wstring BuildControllerFileName( const int aIndex, const int aCtlIndex); |
|
55 static std::wstring EnsureDirectoryTerminated( const std::wstring& aDir ); |
|
56 static bool WildcardCompare( const std::wstring& aWildCardFileName, const std::wstring& aFileName ); |
|
57 // File parsing methods |
|
58 static std::wstring NameAndExt( const std::wstring& aFile ); |
|
59 static std::wstring DriveAndPath( const std::wstring& aFile ); |
|
60 static std::wstring Path( const std::wstring& aFile ); |
|
61 static std::wstring Name( const std::wstring& aFile ); |
|
62 static std::wstring Ext( const std::wstring& aFile ); |
|
63 }; |
|
64 |
|
65 |
|
66 #endif |