LibreOffice Module sw (master) 1
rtfstringbuffer.hxx
Go to the documentation of this file.
1/*
2 * This file is part of the LibreOffice project.
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_RTFSTRINGBUFFER_HXX
10#define INCLUDED_SW_SOURCE_FILTER_WW8_RTFSTRINGBUFFER_HXX
11
12#include <rtl/strbuf.hxx>
13#include <vector>
14
15class SwGrfNode;
18
21{
22public:
26 RtfStringBufferValue(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode);
28 void makeStringAndClear(RtfAttributeOutput* pAttributeOutput);
30 OString makeStringAndClear();
31 bool isGraphic() const;
32 OStringBuffer& getBuffer() { return m_aBuffer; }
33 const OStringBuffer& getBuffer() const { return m_aBuffer; }
34
35private:
36 OStringBuffer m_aBuffer;
38 const SwGrfNode* m_pGrfNode = nullptr;
39};
40
43{
44public:
47 sal_Int32 getLength() const;
49 void makeStringAndClear(RtfAttributeOutput* pAttributeOutput);
51 OString makeStringAndClear();
53 OStringBuffer& getLastBuffer();
54 OStringBuffer* operator->();
56 void clear();
58 void append(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode);
61
62private:
63 using Values_t = std::vector<RtfStringBufferValue>;
65};
66
67#endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFSTRINGBUFFER_HXX
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The class that has handlers for various resource types when exporting as RTF.
Contains a buffered string or graphic during RTF export.
const SwGrfNode * m_pGrfNode
OStringBuffer & getBuffer()
OString makeStringAndClear()
This one doesn't.
const OStringBuffer & getBuffer() const
const SwFlyFrameFormat * m_pFlyFrameFormat
RtfStringBufferValue()
Constructor for a string buffering.
Wrapper around OStringBuffers, so less hexdump of graphics have to be kept in memory during RTF expor...
void clear()
Similar to ->setLength(0), but for all buffers.
void append(const SwFlyFrameFormat *pFlyFrameFormat, const SwGrfNode *pGrfNode)
Same as ->append(), but for graphics and without expanding contents to save memory.
OStringBuffer & getLastBuffer()
Access to the last buffer.
void appendAndClear(RtfStringBuffer &rBuf)
Append all contained buffers and clear the argument.
OString makeStringAndClear()
Returns the buffered strings as a string (ignores graphic elements!)
OStringBuffer * operator->()
std::vector< RtfStringBufferValue > Values_t
sal_Int32 getLength() const
Length of all the contained buffers.