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 
15 class SwGrfNode;
16 class SwFlyFrameFormat;
17 class RtfAttributeOutput;
18 
21 {
22 public:
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 
35 private:
36  OStringBuffer m_aBuffer;
38  const SwGrfNode* m_pGrfNode = nullptr;
39 };
40 
43 {
44 public:
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);
60  void appendAndClear(RtfStringBuffer& rBuf);
61 
62 private:
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: */
sal_Int32 getLength() const
Length of all the contained buffers.
const OStringBuffer & getBuffer() const
Wrapper around OStringBuffers, so less hexdump of graphics have to be kept in memory during RTF expor...
Contains a buffered string or graphic during RTF export.
const SwFlyFrameFormat * m_pFlyFrameFormat
void clear()
Similar to ->setLength(0), but for all buffers.
OStringBuffer & getBuffer()
std::vector< RtfStringBufferValue > Values_t
The class that has handlers for various resource types when exporting as RTF.
void appendAndClear(RtfStringBuffer &rBuf)
Append all contained buffers and clear the argument.
const SwGrfNode * m_pGrfNode
OStringBuffer & getLastBuffer()
Access to the last buffer.
OString makeStringAndClear()
This one doesn't.
void append(const SwFlyFrameFormat *pFlyFrameFormat, const SwGrfNode *pGrfNode)
Same as ->append(), but for graphics and without expanding contents to save memory.
OString makeStringAndClear()
Returns the buffered strings as a string (ignores graphic elements!)
RtfStringBufferValue()
Constructor for a string buffering.
OStringBuffer * operator->()