cid#1636693 COPY_INSTEAD_OF_MOVE
[LibreOffice.git] / include / tools / XmlWalker.hxx
blob653d04d0a4ffd92c9c19a3d70c14256c6905f953
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_TOOLS_XMLWALKER_HXX
11 #define INCLUDED_TOOLS_XMLWALKER_HXX
13 #include <tools/toolsdllapi.h>
14 #include <rtl/string.hxx>
15 #include <memory>
17 class SvStream;
19 namespace tools
21 struct XmlWalkerImpl;
23 /**
24 * XmlWalker main purpose is to make it easier for walking the
25 * parsed XML DOM tree.
27 * It hides all the libxml2 and C -isms and makes the usage more
28 * comfortable from LO developer point of view.
31 class TOOLS_DLLPUBLIC XmlWalker final
33 private:
34 std::unique_ptr<XmlWalkerImpl> mpImpl;
36 public:
37 XmlWalker();
39 ~XmlWalker();
41 bool open(SvStream* pStream);
43 std::string_view name();
44 std::string_view namespaceHref();
45 std::string_view namespacePrefix();
47 OString content();
48 void children();
49 void parent();
50 void next();
51 bool isValid() const;
52 OString attribute(const OString& sName) const;
55 } // end tools namespace
57 #endif // INCLUDED_TOOLS_XMLWRITER_HXX
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */