Kaydet (Commit) ff7ac85d authored tarafından Noel Grandin's avatar Noel Grandin

convert vcl/strhelper.hxx from String to OUString

Change-Id: I1d54431dbd8c562703879a81540f62b3513e9dc9
üst 298772b6
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
namespace psp namespace psp
{ {
VCL_DLLPUBLIC String GetCommandLineToken( int, const String& ); VCL_DLLPUBLIC OUString GetCommandLineToken( int, const OUString& );
VCL_DLLPUBLIC OString GetCommandLineToken(int, const OString&); VCL_DLLPUBLIC OString GetCommandLineToken(int, const OString&);
// gets one token of a unix command line style string // gets one token of a unix command line style string
// doublequote, singlequote and singleleftquote protect their respective // doublequote, singlequote and singleleftquote protect their respective
...@@ -37,7 +37,7 @@ namespace psp ...@@ -37,7 +37,7 @@ namespace psp
VCL_DLLPUBLIC int GetCommandLineTokenCount(const OUString&); VCL_DLLPUBLIC int GetCommandLineTokenCount(const OUString&);
// returns number of tokens (zero if empty or whitespace only) // returns number of tokens (zero if empty or whitespace only)
VCL_DLLPUBLIC String WhitespaceToSpace( const String&, bool bProtect = true ); VCL_DLLPUBLIC OUString WhitespaceToSpace( const OUString&, bool bProtect = true );
VCL_DLLPUBLIC OString WhitespaceToSpace(const OString&, bool bProtect = true); VCL_DLLPUBLIC OString WhitespaceToSpace(const OString&, bool bProtect = true);
// returns a string with multiple adjacent occurrences of whitespace // returns a string with multiple adjacent occurrences of whitespace
// converted to a single space. if bProtect is sal_True (nonzero), then // converted to a single space. if bProtect is sal_True (nonzero), then
...@@ -46,7 +46,7 @@ namespace psp ...@@ -46,7 +46,7 @@ namespace psp
// parses the first double in the string; decimal is '.' only // parses the first double in the string; decimal is '.' only
VCL_DLLPUBLIC inline double StringToDouble( const String& rStr ) VCL_DLLPUBLIC inline double StringToDouble( const OUString& rStr )
{ {
return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
} }
......
...@@ -111,15 +111,15 @@ inline void CopyUntil( sal_Unicode*& pTo, const sal_Unicode*& pFrom, sal_Unicode ...@@ -111,15 +111,15 @@ inline void CopyUntil( sal_Unicode*& pTo, const sal_Unicode*& pFrom, sal_Unicode
pFrom++; pFrom++;
} }
String GetCommandLineToken( int nToken, const String& rLine ) OUString GetCommandLineToken( int nToken, const OUString& rLine )
{ {
int nLen = rLine.Len(); sal_Int32 nLen = rLine.getLength();
if( ! nLen ) if( ! nLen )
return String(); return OUString();
int nActualToken = 0; int nActualToken = 0;
sal_Unicode* pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*( nLen + 1 ) ); sal_Unicode* pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*( nLen + 1 ) );
const sal_Unicode* pRun = rLine.GetBuffer(); const sal_Unicode* pRun = rLine.getStr();
sal_Unicode* pLeap = NULL; sal_Unicode* pLeap = NULL;
while( *pRun && nActualToken <= nToken ) while( *pRun && nActualToken <= nToken )
...@@ -261,14 +261,14 @@ int GetCommandLineTokenCount(const OUString& rLine) ...@@ -261,14 +261,14 @@ int GetCommandLineTokenCount(const OUString& rLine)
return nTokenCount; return nTokenCount;
} }
String WhitespaceToSpace( const String& rLine, bool bProtect ) OUString WhitespaceToSpace( const OUString& rLine, bool bProtect )
{ {
int nLen = rLine.Len(); sal_Int32 nLen = rLine.getLength();
if( ! nLen ) if( ! nLen )
return String(); return OUString();
sal_Unicode *pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*(nLen + 1) ); sal_Unicode *pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*(nLen + 1) );
const sal_Unicode *pRun = rLine.GetBuffer(); const sal_Unicode *pRun = rLine.getStr();
sal_Unicode *pLeap = pBuffer; sal_Unicode *pLeap = pBuffer;
while( *pRun ) while( *pRun )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment