diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 15:18:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 16:57:36 +0200 |
commit | 54ddc13bd2cffea7e8be9cc32083acda3fde9ddd (patch) | |
tree | 6a1873c222b25e618cbdda049cb337d9116d573f /include | |
parent | 717de02367f842a49431b0003eab4f99afec8ab1 (diff) |
Fold INetMIMEStringOutputSink into INetMIMEOutputSink base
Change-Id: I675e656b57fca90e42be2d924c102a995168984d
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/inetmime.hxx | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index 8d4b01a22a90..657fc490dcf7 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -632,16 +632,15 @@ public: private: sal_uInt32 m_nColumn; sal_uInt32 m_nLineLengthLimit; + OStringBuffer m_aBuffer; -protected: /** Write a sequence of octets. @param pBegin Points to the start of the sequence, must not be null. @param pEnd Points past the end of the sequence, must be >= pBegin. */ - virtual void writeSequence(const sal_Char * pBegin, - const sal_Char * pEnd) = 0; + void writeSequence(const sal_Char * pBegin, const sal_Char * pEnd); /** Write a null terminated sequence of octets (without the terminating null). @@ -667,11 +666,11 @@ protected: const sal_Unicode * pEnd); public: - INetMIMEOutputSink(sal_uInt32 nTheColumn, sal_uInt32 nTheLineLengthLimit): + INetMIMEOutputSink( + sal_uInt32 nTheColumn = 0, + sal_uInt32 nTheLineLengthLimit= INetMIME::SOFT_LINE_LENGTH_LIMIT): m_nColumn(nTheColumn), m_nLineLengthLimit(nTheLineLengthLimit) {} - virtual ~INetMIMEOutputSink() {} - /** Get the current column. @return The current column (starting from zero). @@ -737,6 +736,11 @@ public: */ void writeLineEnd(); + OString takeBuffer() + { + return m_aBuffer.makeStringAndClear(); + } + /** A manipulator function that writes a line end (CR LF). @param rSink Some sink. @@ -785,27 +789,6 @@ inline void INetMIME::writeEscapeSequence(INetMIMEOutputSink & rSink, << sal_uInt8(getHexDigit(nChar & 15)); } -class INetMIMEStringOutputSink: public INetMIMEOutputSink -{ - OStringBuffer m_aBuffer; - - using INetMIMEOutputSink::writeSequence; - - virtual void writeSequence(const sal_Char * pBegin, - const sal_Char * pEnd) SAL_OVERRIDE; - -public: - inline INetMIMEStringOutputSink(sal_uInt32 nColumn = 0, - sal_uInt32 nLineLengthLimit - = INetMIME::SOFT_LINE_LENGTH_LIMIT): - INetMIMEOutputSink(nColumn, nLineLengthLimit) {} - - OString takeBuffer() - { - return m_aBuffer.makeStringAndClear(); - } -}; - class INetMIMEEncodedWordOutputSink { public: |