LibreOffice Module filter (master) 1
rtfutil.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef INCLUDED_FILTER_MSFILTER_RTFUTIL_HXX
11#define INCLUDED_FILTER_MSFILTER_RTFUTIL_HXX
12
14#include <rtl/string.hxx>
15#include <rtl/ustring.hxx>
16#include <rtl/textenc.h>
17#include <sal/types.h>
18#include <tools/solar.h>
19
20// RTF values are often multiplied by 2^16
21#define RTF_MULTIPLIER 65536
22
23class SvStream;
24
25namespace msfilter::rtfutil
26{
29
31MSFILTER_DLLPUBLIC OString OutChar(sal_Unicode c, int* pUCMode, rtl_TextEncoding eDestEnc,
32 bool* pSuccess, bool bUnicode = true);
33
41MSFILTER_DLLPUBLIC OString OutString(std::u16string_view rStr, rtl_TextEncoding eDestEnc,
42 bool bUnicode = true);
43
53MSFILTER_DLLPUBLIC OString OutStringUpr(std::string_view pToken, std::u16string_view rStr,
54 rtl_TextEncoding eDestEnc);
55
61MSFILTER_DLLPUBLIC int AsHex(char ch);
62
64MSFILTER_DLLPUBLIC OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize,
65 SvStream* pStream = nullptr, sal_uInt32 nLimit = 64);
66
70MSFILTER_DLLPUBLIC bool ExtractOLE2FromObjdata(const OString& rObjdata, SvStream& rOle2);
71
73MSFILTER_DLLPUBLIC bool StripMetafileHeader(const sal_uInt8*& rpGraphicAry, sal_uInt64& rSize);
74}
75
76#endif
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define MSFILTER_DLLPUBLIC
OString OutStringUpr(std::string_view pToken, std::u16string_view rStr, rtl_TextEncoding eDestEnc)
Handles correct unicode and legacy export of a string, when a '{' \upr '{' keyword ansi_text '}{*' \u...
Definition: rtfutil.cxx:242
OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc, bool *pSuccess, bool bUnicode)
Handles correct unicode and legacy export of a single character.
Definition: rtfutil.cxx:129
OString OutString(std::u16string_view rStr, rtl_TextEncoding eDestEnc, bool bUnicode)
Handles correct unicode and legacy export of a string.
Definition: rtfutil.cxx:213
bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, sal_uInt64 &rSize)
Strips the header of a WMF file.
Definition: rtfutil.cxx:379
OString OutHex(sal_uLong nHex, sal_uInt8 nLen)
Outputs a single character in hex form.
Definition: rtfutil.cxx:98
bool ExtractOLE2FromObjdata(const OString &rObjdata, SvStream &rOle2)
Extract OLE2 data from an \objdata hex dump.
Definition: rtfutil.cxx:303
OString WriteHex(const sal_uInt8 *pData, sal_uInt32 nSize, SvStream *pStream, sal_uInt32 nLimit)
Writes binary data as a hex dump.
Definition: rtfutil.cxx:271
int AsHex(char ch)
Get the numeric value of a single character, representing a hex value.
Definition: rtfutil.cxx:253
sal_uIntPtr sal_uLong
unsigned char sal_uInt8
sal_uInt16 sal_Unicode