diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-12 10:17:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-12 11:51:11 +0100 |
commit | 58ee09b87b11a6a6b56a06f772214e8835810bd3 (patch) | |
tree | 3dba493131b4b9fd670057b8df826bfbbb41fe23 /tools | |
parent | 7bd0fb7d7c0926575d8a7ec5ea2e4a7867f9f8dd (diff) |
ByteString, shrink api
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/string.hxx | 9 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 16 | ||||
-rw-r--r-- | tools/source/string/strcvt.cxx | 17 |
3 files changed, 14 insertions, 28 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 296dc296e72c..1141cd3e2f42 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -167,6 +167,12 @@ private: ByteString( const int* pDummy ); // not implemented: to prevent ByteString( NULL ) ByteString(int); // not implemented; to detect misuses // of ByteString(sal_Char); + ByteString( const UniString& rUniStr, xub_StrLen nPos, xub_StrLen nLen, + rtl_TextEncoding eTextEncoding, + sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); + ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen, + rtl_TextEncoding eTextEncoding, + sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); void Assign(int); // not implemented; to detect misuses of // Assign(sal_Char) void operator =(int); // not implemented; to detect misuses @@ -186,9 +192,6 @@ public: ByteString( const UniString& rUniStr, rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); - ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen, - rtl_TextEncoding eTextEncoding, - sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); ~ByteString(); operator rtl::OString () const diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index d1178f29253e..d8531bfd9f69 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1118,8 +1118,8 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin, } if (p == pAttributeBegin) break; - ByteString aAttribute = ByteString( - pAttributeBegin, static_cast< xub_StrLen >(p - pAttributeBegin), + ByteString aAttribute = rtl::OString( + pAttributeBegin, p - pAttributeBegin, RTL_TEXTENCODING_ASCII_US); if (bDowncaseAttribute) aAttribute.ToLowerAscii(); @@ -1170,9 +1170,9 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin, break; if (pParameters) { - aCharset = ByteString( + aCharset = rtl::OString( pCharsetBegin, - static_cast< xub_StrLen >(p - pCharsetBegin), + p - pCharsetBegin, RTL_TEXTENCODING_ASCII_US); if (bDowncaseCharset) aCharset.ToLowerAscii(); @@ -1205,9 +1205,9 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin, break; if (pParameters) { - aLanguage = ByteString( + aLanguage = rtl::OString( pLanguageBegin, - static_cast< xub_StrLen >(p - pLanguageBegin), + p - pLanguageBegin, RTL_TEXTENCODING_ASCII_US); if (bDowncaseLanguage) aLanguage.ToLowerAscii(); @@ -1301,8 +1301,8 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin, if (p == pTokenBegin) break; if (pParameters) - aValue = ByteString( - pTokenBegin, static_cast< xub_StrLen >(p - pTokenBegin), + aValue = rtl::OString( + pTokenBegin, p - pTokenBegin, RTL_TEXTENCODING_UTF8); } diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx index 210636f8073b..58717bcb5702 100644 --- a/tools/source/string/strcvt.cxx +++ b/tools/source/string/strcvt.cxx @@ -55,23 +55,6 @@ ByteString::ByteString( const UniString& rUniStr, rtl_TextEncoding eTextEncoding eTextEncoding, nCvtFlags ); } -// ----------------------------------------------------------------------- - -ByteString::ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen, - rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags ) -{ - DBG_CTOR( ByteString, DbgCheckByteString ); - DBG_ASSERT( pUniStr, "ByteString::ByteString() - pUniStr is NULL" ); - - if ( nLen == STRING_LEN ) - nLen = ImplStringLen( pUniStr ); - - mpData = NULL; - rtl_uString2String( (rtl_String **)(&mpData), - pUniStr, nLen, - eTextEncoding, nCvtFlags ); -} - // ======================================================================= static sal_uChar aImplByteTab[256] = |