1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
13 #include <rtl/string.hxx>
14 #include <string_view>
16 #include <svtools/svtdllapi.h>
20 class SVT_DLLPUBLIC HtmlWriter final
23 std::vector
<OString
> maElementStack
;
28 bool mbCharactersWritten
;
30 /// XML namespace, in case of XHTML.
34 HtmlWriter(SvStream
& rStream
, std::string_view rNamespace
= std::string_view());
37 void prettyPrint(bool b
);
39 void start(const OString
& aElement
);
41 bool end(const OString
& aElement
);
46 static void writeAttribute(SvStream
& rStream
, std::string_view aAttribute
, sal_Int32 aValue
);
47 static void writeAttribute(SvStream
& rStream
, std::string_view aAttribute
,
48 std::string_view aValue
);
50 void attribute(std::string_view aAttribute
, const char* aValue
);
51 void attribute(std::string_view aAttribute
, sal_Int32 aValue
);
52 void attribute(std::string_view aAttribute
, std::string_view aValue
);
53 void attribute(std::string_view aAttribute
, std::u16string_view aValue
);
54 // boolean attribute e.g. <img ismap>
55 void attribute(std::string_view aAttribute
);
57 void single(const OString
& aContent
);
60 /// Writes character data.
61 void characters(std::string_view rChars
);
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */