diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 19:18:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 22:22:32 +0200 |
commit | f4fb4c531dd89efbda672fc7e6d62fc3727a6b69 (patch) | |
tree | 53befd4a38eb19acae6cbd4f302843e055c07c0e /include | |
parent | 984780243c9a1ab1242f3af719c6dca3ddacf67a (diff) |
Make INetMIMEEncodedWordOutputSink local to inetmime.cxx
Change-Id: I779bde650b7fc21af93b573a55fab5b6fff03790
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/inetmime.hxx | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index 6746962b85a0..37fda605e914 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -649,98 +649,6 @@ inline void INetMIME::writeEscapeSequence(INetMIMEOutputSink & rSink, << sal_uInt8(getHexDigit(nChar & 15)); } -class INetMIMEEncodedWordOutputSink -{ -public: - enum Context { CONTEXT_TEXT = 1, - CONTEXT_COMMENT = 2, - CONTEXT_PHRASE = 4 }; - - enum Space { SPACE_NO, SPACE_ENCODED, SPACE_ALWAYS }; - -private: - enum { BUFFER_SIZE = 256 }; - - enum Coding { CODING_NONE, CODING_QUOTED, CODING_ENCODED, - CODING_ENCODED_TERMINATED }; - - enum EncodedWordState { STATE_INITIAL, STATE_FIRST_EQUALS, - STATE_FIRST_QUESTION, STATE_CHARSET, - STATE_SECOND_QUESTION, STATE_ENCODING, - STATE_THIRD_QUESTION, STATE_ENCODED_TEXT, - STATE_FOURTH_QUESTION, STATE_SECOND_EQUALS, - STATE_BAD }; - - INetMIMEOutputSink & m_rSink; - Context m_eContext; - Space m_eInitialSpace; - sal_uInt32 m_nExtraSpaces; - INetMIMECharsetList_Impl * m_pEncodingList; - sal_Unicode * m_pBuffer; - sal_uInt32 m_nBufferSize; - sal_Unicode * m_pBufferEnd; - Coding m_ePrevCoding; - rtl_TextEncoding m_ePrevMIMEEncoding; - Coding m_eCoding; - EncodedWordState m_eEncodedWordState; - - inline bool needsEncodedWordEscape(sal_uInt32 nChar) const; - - void finish(bool bWriteTrailer); - -public: - inline INetMIMEEncodedWordOutputSink(INetMIMEOutputSink & rTheSink, - Context eTheContext, - Space eTheInitialSpace, - rtl_TextEncoding ePreferredEncoding); - - ~INetMIMEEncodedWordOutputSink(); - - INetMIMEEncodedWordOutputSink & WriteUInt32(sal_uInt32 nChar); - - inline void write(const sal_Unicode * pBegin, const sal_Unicode * pEnd); - - inline bool flush(); -}; - -inline INetMIMEEncodedWordOutputSink::INetMIMEEncodedWordOutputSink( - INetMIMEOutputSink & rTheSink, Context eTheContext, - Space eTheInitialSpace, rtl_TextEncoding ePreferredEncoding): - m_rSink(rTheSink), - m_eContext(eTheContext), - m_eInitialSpace(eTheInitialSpace), - m_nExtraSpaces(0), - m_pEncodingList(INetMIME::createPreferredCharsetList(ePreferredEncoding)), - m_ePrevCoding(CODING_NONE), - m_ePrevMIMEEncoding(RTL_TEXTENCODING_DONTKNOW), - m_eCoding(CODING_NONE), - m_eEncodedWordState(STATE_INITIAL) -{ - m_nBufferSize = BUFFER_SIZE; - m_pBuffer = static_cast< sal_Unicode * >(rtl_allocateMemory( - m_nBufferSize - * sizeof (sal_Unicode))); - m_pBufferEnd = m_pBuffer; -} - - - -inline void INetMIMEEncodedWordOutputSink::write(const sal_Unicode * pBegin, - const sal_Unicode * pEnd) -{ - DBG_ASSERT(pBegin && pBegin <= pEnd, - "INetMIMEEncodedWordOutputSink::write(): Bad sequence"); - - while (pBegin != pEnd) - WriteUInt32(*pBegin++); -} - -inline bool INetMIMEEncodedWordOutputSink::flush() -{ - finish(true); - return m_ePrevCoding != CODING_NONE; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |