summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-23 00:03:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-23 09:08:07 +0100
commitf1251f68b178860c33521254c9dd4d9b35a96202 (patch)
tree8e3156e5a1e28eceb0c8ed2c4768e2b801797b1b
parentthis method is debugging only (diff)
downloadcore-f1251f68b178860c33521254c9dd4d9b35a96202.tar.gz
core-f1251f68b178860c33521254c9dd4d9b35a96202.zip
remove parse ByteString variant
-rw-r--r--svl/inc/svl/inettype.hxx31
-rw-r--r--svl/source/misc/inettype.cxx45
-rw-r--r--svtools/source/svhtml/parhtml.cxx7
3 files changed, 3 insertions, 80 deletions
diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index 8f667ae908d4..54dbda7b75d4 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -391,37 +391,6 @@ public:
with intervening linear white space and comments (cf. RFCs 822, 2045).
The RFC 2231 extension are supported. The encoding of rMediaType
- should be US-ASCII, but any values in the range 0x80--0xFF are
- interpretet 'as appropriate.'
-
- @param rType Returns the type (the first of the above tokens), in US-
- ASCII encoding and converted to lower case.
-
- @param rSubType Returns the sub type (the second of the above
- tokens), in US-ASCII encoding and converted to lower case.
-
- @param rParameters If not null, returns the parameters as a list of
- INetContentTypeParameters (the attributes are in US-ASCII encoding and
- converted to lower case, the values are in Unicode encoding). If
- null, only the syntax of the parameters is checked, but they are not
- returned.
-
- @return True if the syntax of the field body is correct. If false is
- returned, none of the output parameters will be modified!
- */
- static bool parse(ByteString const & rMediaType, ByteString & rType,
- ByteString & rSubType,
- INetContentTypeParameterList * pParameters = 0);
-
- /** Parse the body of an RFC 2045 Content-Type header field.
-
- @param rMediaType The body of the Content-Type header field. It must
- be of the form
-
- token "/" token *(";" token "=" (token / quoted-string))
-
- with intervening linear white space and comments (cf. RFCs 822, 2045).
- The RFC 2231 extension are supported. The encoding of rMediaType
should be US-ASCII, but any Unicode values in the range U+0080..U+FFFF
are interpretet 'as appropriate.'
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 819d9026f1d6..762f53061dcf 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -1149,51 +1149,6 @@ INetContentType INetContentTypes::MapStringToContentType(UniString const &
//============================================================================
// static
-bool INetContentTypes::parse(ByteString const & rMediaType,
- ByteString & rType, ByteString & rSubType,
- INetContentTypeParameterList * pParameters)
-{
- sal_Char const * p = rMediaType.GetBuffer();
- sal_Char const * pEnd = p + rMediaType.Len();
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- sal_Char const * pToken = p;
- bool bDowncase = false;
- while (p != pEnd && INetMIME::isTokenChar(*p))
- {
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
- ++p;
- }
- if (p == pToken)
- return false;
- rType = ByteString(pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
- if (bDowncase)
- rType.ToLowerAscii();
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd || *p++ != '/')
- return false;
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- pToken = p;
- bDowncase = false;
- while (p != pEnd && INetMIME::isTokenChar(*p))
- {
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
- ++p;
- }
- if (p == pToken)
- return false;
- rSubType = ByteString(
- pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
- if (bDowncase)
- rSubType.ToLowerAscii();
-
- return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
-}
-
-//============================================================================
-// static
bool INetContentTypes::parse(UniString const & rMediaType,
UniString & rType, UniString & rSubType,
INetContentTypeParameterList * pParameters)
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 8cf6f406e2bd..b431d0d931c7 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2266,11 +2266,10 @@ bool HTMLParser::ParseMetaOptions(
rtl_TextEncoding HTMLParser::GetEncodingByMIME( const String& rMime )
{
- ByteString sType;
- ByteString sSubType;
+ String sType;
+ String sSubType;
INetContentTypeParameterList aParameters;
- ByteString sMime( rMime, RTL_TEXTENCODING_ASCII_US );
- if (INetContentTypes::parse(sMime, sType, sSubType, &aParameters))
+ if (INetContentTypes::parse(rMime, sType, sSubType, &aParameters))
{
const INetContentTypeParameter * pCharset
= aParameters.find("charset");