diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-07-13 22:48:22 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-07-14 08:19:57 +0200 |
commit | b272991c334e008537d5aa1b782e1f4a3dab6da8 (patch) | |
tree | 4a3085fe2610b9bc9c1a19f83b601e47d15888ce | |
parent | 734485db6a9612879eec051d6a857aa5563f2235 (diff) |
callcatcher: cleanup INetMIME
-rw-r--r-- | tools/inc/tools/inetmime.hxx | 54 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 256 |
2 files changed, 0 insertions, 310 deletions
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 2c4c425f79e1..a9407126a93f 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -377,8 +377,6 @@ public: @return The Base 64 digit corresponding to nWeight (US-ASCII 'A'-- 'Z', 'a'--'z', '0'--'9', '+' or '/'). */ - static sal_uInt32 getBase64Digit(int nWeight); - static inline bool isHighSurrogate(sal_uInt32 nUTF16); static inline bool isLowSurrogate(sal_uInt32 nUTF16); @@ -394,28 +392,6 @@ public: @param pEnd1 Points past the end of the first string, must be >= pBegin1. - @param pBegin2 Points to the start of the second string, must not be - null. - - @param pEnd2 Points past the end of the second string, must be >= - pBegin2. - - @return True if the two strings are equal, ignoring the case of US- - ASCII alphabetic characters (US-ASCII 'A'--'Z' and 'a'--'z'). - */ - static bool equalIgnoreCase(const sal_Char * pBegin1, - const sal_Char * pEnd1, - const sal_Char * pBegin2, - const sal_Char * pEnd2); - - /** Check two US-ASCII strings for equality, ignoring case. - - @param pBegin1 Points to the start of the first string, must not be - null. - - @param pEnd1 Points past the end of the first string, must be >= - pBegin1. - @param pString2 Points to the start of the null terminated second string, must not be null. @@ -472,9 +448,6 @@ public: static bool startsWithLinearWhiteSpace(const sal_Char * pBegin, const sal_Char * pEnd); - static const sal_Char * skipLinearWhiteSpace(const sal_Char * pBegin, - const sal_Char * pEnd); - static const sal_Unicode * skipLinearWhiteSpace(const sal_Unicode * pBegin, const sal_Unicode * pEnd); @@ -503,12 +476,6 @@ public: static const sal_Unicode * skipQuotedString(const sal_Unicode * pBegin, const sal_Unicode * pEnd); - static const sal_Char * scanAtom(const sal_Char * pBegin, - const sal_Char * pEnd); - - static const sal_Unicode * scanAtom(const sal_Unicode * pBegin, - const sal_Unicode * pEnd); - static bool scanUnsigned(const sal_Char *& rBegin, const sal_Char * pEnd, bool bLeadingZeroes, sal_uInt32 & rValue); @@ -516,21 +483,6 @@ public: const sal_Unicode * pEnd, bool bLeadingZeroes, sal_uInt32 & rValue); - static bool scanUnsignedHex(const sal_Char *& rBegin, - const sal_Char * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue); - - static bool scanUnsignedHex(const sal_Unicode *& rBegin, - const sal_Unicode * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue); - - static const sal_Char * scanQuotedBlock(const sal_Char * pBegin, - const sal_Char * pEnd, - sal_uInt32 nOpening, - sal_uInt32 nClosing, - sal_Size & rLength, - bool & rModify); - static const sal_Unicode * scanQuotedBlock(const sal_Unicode * pBegin, const sal_Unicode * pEnd, sal_uInt32 nOpening, @@ -559,9 +511,6 @@ public: static rtl_TextEncoding getCharsetEncoding(const sal_Char * pBegin, const sal_Char * pEnd); - static rtl_TextEncoding getCharsetEncoding(const sal_Unicode * pBegin, - const sal_Unicode * pEnd); - static inline bool isMIMECharsetEncoding(rtl_TextEncoding eEncoding); static INetMIMECharsetList_Impl * @@ -594,9 +543,6 @@ public: static void writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, int nMinDigits = 1); - static void writeDateTime(INetMIMEOutputSink & rSink, - const DateTime & rUTC); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 83a3741a72cf..1db41b4d73ba 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -517,40 +517,6 @@ sal_uInt32 INetMIME::getHexDigit(int nWeight) //============================================================================ // static -sal_uInt32 INetMIME::getBase64Digit(int nWeight) -{ - DBG_ASSERT(nWeight >= 0 && nWeight < 64, - "INetMIME::getBase64Digit(): Bad weight"); - - static const sal_Char aDigits[64] - = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; - return aDigits[nWeight]; -} - -//============================================================================ -// static -bool INetMIME::equalIgnoreCase(const sal_Char * pBegin1, - const sal_Char * pEnd1, - const sal_Char * pBegin2, - const sal_Char * pEnd2) -{ - DBG_ASSERT(pBegin1 && pBegin1 <= pEnd1 && pBegin2 && pBegin2 <= pEnd2, - "INetMIME::equalIgnoreCase(): Bad sequences"); - - if (pEnd1 - pBegin1 != pEnd2 - pBegin2) - return false; - while (pBegin1 != pEnd1) - if (toUpperCase(*pBegin1++) != toUpperCase(*pBegin2++)) - return false; - return true; -} - -//============================================================================ -// static bool INetMIME::equalIgnoreCase(const sal_Char * pBegin1, const sal_Char * pEnd1, const sal_Char * pString2) @@ -583,35 +549,6 @@ bool INetMIME::equalIgnoreCase(const sal_Unicode * pBegin1, //============================================================================ // static -const sal_Char * INetMIME::skipLinearWhiteSpace(const sal_Char * pBegin, - const sal_Char * pEnd) -{ - DBG_ASSERT(pBegin && pBegin <= pEnd, - "INetMIME::skipLinearWhiteSpace(): Bad sequence"); - - while (pBegin != pEnd) - switch (*pBegin) - { - case '\t': - case ' ': - ++pBegin; - break; - - case 0x0D: // CR - if (startsWithLineFolding(pBegin, pEnd)) - pBegin += 3; - else - return pBegin; - break; - - default: - return pBegin; - } - return pBegin; -} - -//============================================================================ -// static const sal_Unicode * INetMIME::skipLinearWhiteSpace(const sal_Unicode * pBegin, const sal_Unicode * pEnd) { @@ -842,26 +779,6 @@ const sal_Unicode * INetMIME::skipQuotedString(const sal_Unicode * pBegin, //============================================================================ // static -const sal_Char * INetMIME::scanAtom(const sal_Char * pBegin, - const sal_Char * pEnd) -{ - while (pBegin != pEnd && isAtomChar(*pBegin)) - ++pBegin; - return pBegin; -} - -//============================================================================ -// static -const sal_Unicode * INetMIME::scanAtom(const sal_Unicode * pBegin, - const sal_Unicode * pEnd) -{ - while (pBegin != pEnd && isAtomChar(*pBegin)) - ++pBegin; - return pBegin; -} - -//============================================================================ -// static bool INetMIME::scanUnsigned(const sal_Char *& rBegin, const sal_Char * pEnd, bool bLeadingZeroes, sal_uInt32 & rValue) { @@ -909,127 +826,6 @@ bool INetMIME::scanUnsigned(const sal_Unicode *& rBegin, //============================================================================ // static -bool INetMIME::scanUnsignedHex(const sal_Char *& rBegin, - const sal_Char * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue) -{ - sal_uInt64 nTheValue = 0; - const sal_Char * p = rBegin; - for ( p = rBegin; p != pEnd; ++p) - { - int nWeight = getHexWeight(*p); - if (nWeight < 0) - break; - nTheValue = nTheValue << 4 | nWeight; - if (nTheValue > std::numeric_limits< sal_uInt32 >::max()) - return false; - } - if (nTheValue == 0 && (p == rBegin || (!bLeadingZeroes && p - rBegin != 1))) - return false; - rBegin = p; - rValue = sal_uInt32(nTheValue); - return true; -} - -//============================================================================ -// static -bool INetMIME::scanUnsignedHex(const sal_Unicode *& rBegin, - const sal_Unicode * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue) -{ - sal_uInt64 nTheValue = 0; - const sal_Unicode * p = rBegin; - for ( ; p != pEnd; ++p) - { - int nWeight = getHexWeight(*p); - if (nWeight < 0) - break; - nTheValue = nTheValue << 4 | nWeight; - if (nTheValue > std::numeric_limits< sal_uInt32 >::max()) - return false; - } - if (nTheValue == 0 && (p == rBegin || (!bLeadingZeroes && p - rBegin != 1))) - return false; - rBegin = p; - rValue = sal_uInt32(nTheValue); - return true; -} - -//============================================================================ -// static -const sal_Char * INetMIME::scanQuotedBlock(const sal_Char * pBegin, - const sal_Char * pEnd, - sal_uInt32 nOpening, - sal_uInt32 nClosing, - sal_Size & rLength, - bool & rModify) -{ - DBG_ASSERT(pBegin && pBegin <= pEnd, - "INetMIME::scanQuotedBlock(): Bad sequence"); - - if (pBegin != pEnd && static_cast< unsigned char >(*pBegin) == nOpening) - { - ++rLength; - ++pBegin; - while (pBegin != pEnd) - if (static_cast< unsigned char >(*pBegin) == nClosing) - { - ++rLength; - return ++pBegin; - } - else - { - sal_uInt32 c = *pBegin++; - switch (c) - { - case 0x0D: // CR - if (pBegin != pEnd && *pBegin == 0x0A) // LF - if (pEnd - pBegin >= 2 && isWhiteSpace(pBegin[1])) - { - ++rLength; - rModify = true; - pBegin += 2; - } - else - { - rLength += 3; - rModify = true; - ++pBegin; - } - else - ++rLength; - break; - - case '\\': - ++rLength; - if (pBegin != pEnd) - { - if (startsWithLineBreak(pBegin, pEnd) - && (pEnd - pBegin < 3 - || !isWhiteSpace(pBegin[2]))) - { - rLength += 3; - rModify = true; - pBegin += 2; - } - else - ++pBegin; - } - break; - - default: - ++rLength; - if (!isUSASCII(c)) - rModify = true; - break; - } - } - } - return pBegin; -} - -//============================================================================ -// static const sal_Unicode * INetMIME::scanQuotedBlock(const sal_Unicode * pBegin, const sal_Unicode * pEnd, sal_uInt32 nOpening, @@ -1767,14 +1563,6 @@ rtl_TextEncoding INetMIME::getCharsetEncoding(sal_Char const * pBegin, //============================================================================ // static -rtl_TextEncoding INetMIME::getCharsetEncoding(sal_Unicode const * pBegin, - sal_Unicode const * pEnd) -{ - return getCharsetEncoding_Impl(pBegin, pEnd); -} - -//============================================================================ -// static INetMIMECharsetList_Impl * INetMIME::createPreferredCharsetList(rtl_TextEncoding eEncoding) { @@ -2187,50 +1975,6 @@ void INetMIME::writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, //============================================================================ // static -void INetMIME::writeDateTime(INetMIMEOutputSink & rSink, - const DateTime & rUTC) -{ - static const sal_Char aDay[7][3] - = { { 'M', 'o', 'n' }, - { 'T', 'u', 'e' }, - { 'W', 'e', 'd' }, - { 'T', 'h', 'u' }, - { 'F', 'r', 'i' }, - { 'S', 'a', 't' }, - { 'S', 'u', 'n' } }; - const sal_Char * pTheDay = aDay[rUTC.GetDayOfWeek()]; - rSink.write(pTheDay, pTheDay + 3); - rSink << ", "; - writeUnsigned(rSink, rUTC.GetDay()); - rSink << ' '; - static const sal_Char aMonth[12][3] - = { { 'J', 'a', 'n' }, - { 'F', 'e', 'b' }, - { 'M', 'a', 'r' }, - { 'A', 'p', 'r' }, - { 'M', 'a', 'y' }, - { 'J', 'u', 'n' }, - { 'J', 'u', 'l' }, - { 'A', 'u', 'g' }, - { 'S', 'e', 'p' }, - { 'O', 'c', 't' }, - { 'N', 'o', 'v' }, - { 'D', 'e', 'c' } }; - const sal_Char * pTheMonth = aMonth[rUTC.GetMonth() - 1]; - rSink.write(pTheMonth, pTheMonth + 3); - rSink << ' '; - writeUnsigned(rSink, rUTC.GetYear()); - rSink << ' '; - writeUnsigned(rSink, rUTC.GetHour(), 2); - rSink << ':'; - writeUnsigned(rSink, rUTC.GetMin(), 2); - rSink << ':'; - writeUnsigned(rSink, rUTC.GetSec(), 2); - rSink << " +0000"; -} - -//============================================================================ -// static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, |