secureswitools/swisistools/source/interpretsislib/stringutils.h
branchRCL_3
changeset 62 5cc91383ab1e
parent 0 ba25891c3a9e
child 81 42552535c1ac
equal deleted inserted replaced
61:cd189dac02f7 62:5cc91383ab1e
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    33 
    33 
    34 // User includes
    34 // User includes
    35 #include "symbiantypes.h"
    35 #include "symbiantypes.h"
    36 
    36 
    37 // Constants
    37 // Constants
       
    38 #ifndef __TOOLS2_LINUX__
    38 const std::wstring KDirectorySeparator( L"\\" );
    39 const std::wstring KDirectorySeparator( L"\\" );
       
    40 const std::wstring KDoubleSlashPathPrefix( L"\\\\" );
       
    41 const std::string KDirectorySeparatorString( "\\" );
       
    42 const std::string KDoubleSlashPathPrefixString( "\\\\" );
       
    43 #else
       
    44 const std::wstring KDirectorySeparator( L"/" );
       
    45 const std::wstring KDoubleSlashPathPrefix( L"//" );
       
    46 const std::string KDirectorySeparatorString( "/" );
       
    47 const std::string KDoubleSlashPathPrefixString( "//" );
       
    48 #endif
    39 
    49 
    40 class StringUtils
    50 class StringUtils
    41 	{
    51 	{
    42 public:
    52 public:
    43 	static int FirstInvalidDirSeparatorSize(std::wstring& aPath, std::wstring::size_type& aIndex);
    53 	static int FirstInvalidDirSeparatorSize(std::wstring& aPath, std::wstring::size_type& aIndex);
    45     static std::string TrimWhiteSpace( const std::string& aString );
    55     static std::string TrimWhiteSpace( const std::string& aString );
    46     static bool CheckForMatch( const std::string& aSearchFor, std::string& aLine );
    56     static bool CheckForMatch( const std::string& aSearchFor, std::string& aLine );
    47     static std::string ToUpper( const std::string& aString );
    57     static std::string ToUpper( const std::string& aString );
    48 	static std::wstring ToUpper( const std::wstring& aString );
    58 	static std::wstring ToUpper( const std::wstring& aString );
    49 	static std::string ToLower( const std::string& aString );
    59 	static std::string ToLower( const std::string& aString );
       
    60 	static std::wstring ToLower( const std::wstring& aString );
    50     static bool IsLastCharacter( const std::wstring& aString, wchar_t aChar );
    61     static bool IsLastCharacter( const std::wstring& aString, wchar_t aChar );
    51     static bool StartsWithDrive( const std::wstring& aText );
    62     static bool StartsWithDrive( const std::wstring& aText );
    52     static std::wstring MakePathFromSID( const std::wstring& aBasePath, TUint32 aSID );
    63     static std::wstring MakePathFromSID( const std::wstring& aBasePath, TUint32 aSID );
    53 	static std::wstring BuildSisRegistryFileName( const int aIndex );
    64 	static std::wstring BuildSisRegistryFileName( const int aIndex );
    54 	static std::wstring BuildControllerFileName( const int aIndex, const int aCtlIndex);
    65 	static std::wstring BuildControllerFileName( const int aIndex, const int aCtlIndex);