summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-24 09:16:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-24 15:29:52 +0000
commit56d168cc59a352ec432e09b8ba471b858387023c (patch)
tree439c0e3aac70e91b78b6df167262bf1a36177ba7 /tools
parent9a6c74171b401310d143cfe1b0d1a0be1a4108c3 (diff)
strip down old string class some more
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/string.hxx5
-rw-r--r--tools/source/string/strimp.cxx53
-rw-r--r--tools/source/string/tustring.cxx32
3 files changed, 32 insertions, 58 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index c9258bea0117..11716ffb9c26 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -234,10 +234,6 @@ public:
ByteString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
ByteString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
- ByteString& EraseLeadingChars( sal_Char c = ' ' );
- ByteString& EraseTrailingChars( sal_Char c = ' ' );
- ByteString& EraseLeadingAndTrailingChars( sal_Char c = ' ' );
-
ByteString& ConvertLineEnd( LineEnd eLineEnd );
ByteString& ConvertLineEnd()
{ return ConvertLineEnd( GetSystemLineEnd() ); }
@@ -489,7 +485,6 @@ public:
UniString& EraseLeadingChars( sal_Unicode c = ' ' );
UniString& EraseTrailingChars( sal_Unicode c = ' ' );
- UniString& EraseLeadingAndTrailingChars( sal_Unicode c = ' ' );
UniString& Reverse();
UniString& ConvertLineEnd( LineEnd eLineEnd );
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index aad7df6dd67e..33c0572867d2 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -757,59 +757,6 @@ STRING& STRING::Erase( xub_StrLen nIndex, xub_StrLen nCount )
// -----------------------------------------------------------------------
-STRING& STRING::EraseLeadingChars( STRCODE c )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- if ( mpData->maStr[0] != c )
- return *this;
-
- xub_StrLen nStart = 0;
- while ( mpData->maStr[nStart] == c )
- ++nStart;
-
- return Erase( 0, nStart );
-}
-
-// -----------------------------------------------------------------------
-
-STRING& STRING::EraseTrailingChars( STRCODE c )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- sal_Int32 nEnd = mpData->mnLen;
- while ( nEnd && (mpData->maStr[nEnd-1] == c) )
- nEnd--;
-
- if ( nEnd != mpData->mnLen )
- Erase( static_cast< xub_StrLen >(nEnd) );
-
- return *this;
-}
-
-// -----------------------------------------------------------------------
-
-STRING& STRING::EraseLeadingAndTrailingChars( STRCODE c )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- xub_StrLen nStart = 0;
- while ( mpData->maStr[nStart] == c )
- ++nStart;
- if ( nStart )
- Erase( 0, nStart );
-
- sal_Int32 nEnd = mpData->mnLen;
- while ( nEnd && (mpData->maStr[nEnd-1] == c) )
- nEnd--;
- if ( nEnd != mpData->mnLen )
- Erase( static_cast< xub_StrLen >(nEnd) );
-
- return *this;
-}
-
-// -----------------------------------------------------------------------
-
STRING& STRING::ToLowerAscii()
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index 30a0fd508f49..79a7ebc3febd 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -576,4 +576,36 @@ STRING::STRING( STRCODE c )
mpData->maStr[0] = c;
}
+// -----------------------------------------------------------------------
+
+STRING& STRING::EraseLeadingChars( STRCODE c )
+{
+ DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+ if ( mpData->maStr[0] != c )
+ return *this;
+
+ xub_StrLen nStart = 0;
+ while ( mpData->maStr[nStart] == c )
+ ++nStart;
+
+ return Erase( 0, nStart );
+}
+
+// -----------------------------------------------------------------------
+
+STRING& STRING::EraseTrailingChars( STRCODE c )
+{
+ DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+
+ sal_Int32 nEnd = mpData->mnLen;
+ while ( nEnd && (mpData->maStr[nEnd-1] == c) )
+ nEnd--;
+
+ if ( nEnd != mpData->mnLen )
+ Erase( static_cast< xub_StrLen >(nEnd) );
+
+ return *this;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */