summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-21 23:26:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-22 09:25:35 +0100
commita9bec36b0444ae0c0eaf92db22efb456227c4f93 (patch)
treea5a5bb61ef58ea25779f66cdfb67200a4a1bc70a /svl
parentac96c998b9ed4cff056a05d343a2ec0a3ce15a60 (diff)
remove unused appendUSASCIIParameter methods
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/inettype.hxx36
-rw-r--r--svl/source/misc/inettype.cxx112
2 files changed, 0 insertions, 148 deletions
diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index 3abe09c0e37c..8f667ae908d4 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -443,42 +443,6 @@ public:
static bool parse(UniString const & rMediaType, UniString & rType,
UniString & rSubType,
INetContentTypeParameterList * pParameters = 0);
-
- /** Append a parameter to the string representation of a MIME media type.
-
- @param rMediaType The string representation of a MIME media type.
-
- @param rAttribute The name of the parameter. Must be a valid RFC
- 2045 token.
-
- @param rValue The value of the paramter. Must only consist of US-
- ASCII characters.
-
- @return The string representation of rMediaType with the new
- parameter appended. It is not checked whether a parameter with that
- name already existed in rMediaType.
- */
- static ByteString appendUSASCIIParameter(ByteString const & rMediaType,
- ByteString const & rAttribute,
- ByteString const & rValue);
-
- /** Append a parameter to the string representation of a MIME media type.
-
- @param rMediaType The string representation of a MIME media type.
-
- @param rAttribute The name of the parameter. Must be a valid RFC
- 2045 token.
-
- @param rValue The value of the paramter. Must only consist of US-
- ASCII characters.
-
- @return The string representation of rMediaType with the new
- parameter appended. It is not checked whether a parameter with that
- name already existed in rMediaType.
- */
- static UniString appendUSASCIIParameter(UniString const & rMediaType,
- UniString const & rAttribute,
- UniString const & rValue);
};
#endif // _INETTYPE_HXX
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index cb16349ab487..819d9026f1d6 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -1237,116 +1237,4 @@ bool INetContentTypes::parse(UniString const & rMediaType,
return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
}
-//============================================================================
-// static
-ByteString INetContentTypes::appendUSASCIIParameter(ByteString const &
- rMediaType,
- ByteString const &
- rAttribute,
- ByteString const & rValue)
-{
- ByteString aResult = rMediaType;
- aResult.Append(RTL_CONSTASCII_STRINGPARAM("; "));
- aResult += rAttribute;
- aResult += '=';
- bool bQuote = false;
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // When the value contains any ' characters, use a quoted string
- // instead of a token, in order to avoid confusion with RFC 2231
- // extensions:
- sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter(): Bad value");
- if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
- {
- bQuote = true;
- break;
- }
- }
- if (bQuote)
- {
- aResult += '"';
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // Escape LF as well as CR to avoid confusion with line folding:
- sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter():"
- " Bad value");
- switch (nChar)
- {
- case 0x0A: // LF
- case 0x0D: // CR
- case '"':
- case '\\':
- aResult += '\\';
- default:
- aResult += static_cast< char >(nChar);
- break;
- }
- }
- aResult += '"';
- }
- else
- aResult += rValue;
- return aResult;
-}
-
-//============================================================================
-// static
-UniString INetContentTypes::appendUSASCIIParameter(UniString const &
- rMediaType,
- UniString const &
- rAttribute,
- UniString const & rValue)
-{
- UniString aResult = rMediaType;
- aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM("; "));
- aResult += rAttribute;
- aResult += '=';
- bool bQuote = false;
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // When the value contains any ' characters, use a quoted string
- // instead of a token, in order to avoid confusion with RFC 2231
- // extensions:
- sal_uInt32 nChar = rValue.GetChar(i);
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter(): Bad value");
- if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
- {
- bQuote = true;
- break;
- }
- }
- if (bQuote)
- {
- aResult += '"';
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // Escape LF as well as CR to avoid confusion with line folding:
- sal_uInt32 nChar = rValue.GetChar(i);
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter():"
- " Bad value");
- switch (nChar)
- {
- case 0x0A: // LF
- case 0x0D: // CR
- case '"':
- case '\\':
- aResult += '\\';
- default:
- aResult += sal_Unicode(nChar);
- break;
- }
- }
- aResult += '"';
- }
- else
- aResult += rValue;
- return aResult;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */