LibreOffice Module shell (master) 1
xml_parser.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SHELL_INC_INTERNAL_XML_PARSER_HXX
21#define INCLUDED_SHELL_INC_INTERNAL_XML_PARSER_HXX
22
23#include <expat.h>
24#include <stdexcept>
25
26class xml_parser_exception final : public std::runtime_error
27{
28public:
29 xml_parser_exception(const std::string& error_msg)
30 : std::runtime_error(error_msg)
31 {
32 }
33};
34
35// Simple wrapper around expat, the xml parser library
36// created by James Clark
37
39
41{
42public:
43 xml_parser();
44
46
66 void parse(const char* XmlData, size_t Length, bool IsFinal);
67
85
89
90private:
91 void init();
92
93private:
95 XML_Parser xml_parser_;
96
97private:
98 xml_parser(const xml_parser&) = delete;
99 xml_parser& operator=(const xml_parser&) = delete;
100};
101
102#endif
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
xml_parser_exception(const std::string &error_msg)
Definition: xml_parser.hxx:29
i_xml_parser_event_handler * document_handler_
Definition: xml_parser.hxx:94
void init()
Definition: xml_parser.cxx:151
void set_document_handler(i_xml_parser_event_handler *event_handler)
Set a document handler.
Definition: xml_parser.cxx:185
i_xml_parser_event_handler * get_document_handler() const
Returns the currently used document handler or null if no document handler was set before.
Definition: xml_parser.hxx:88
void parse(const char *XmlData, size_t Length, bool IsFinal)
Parse a XML data stream.
Definition: xml_parser.cxx:175
xml_parser & operator=(const xml_parser &)=delete
XML_Parser xml_parser_
Definition: xml_parser.hxx:95
xml_parser(const xml_parser &)=delete
Length