/usr/include/libxml++-2.6/libxml++/parsers/parser.h is in libxml++2.6-dev 2.34.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | /* parser.h
* libxml++ and this file are copyright (C) 2000 by Ari Johnson, and
* are covered by the GNU Lesser General Public License, which should be
* included with libxml++ as the file COPYING.
*/
#ifndef __LIBXMLPP_PARSER_H
#define __LIBXMLPP_PARSER_H
#ifdef _MSC_VER //Ignore warnings about the Visual C++ Bug, where we can not do anything
#pragma warning (disable : 4786)
#endif
#include <libxml++/nodes/element.h>
#include <libxml++/exceptions/validity_error.h>
#include <libxml++/exceptions/internal_error.h>
#include <istream>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" {
struct _xmlParserCtxt;
}
#endif //DOXYGEN_SHOULD_SKIP_THIS
namespace xmlpp {
/** XML parser.
*
*/
class Parser : NonCopyable
{
public:
Parser();
virtual ~Parser();
typedef unsigned int size_type;
/** By default, the parser will not validate the XML file.
* @param val Whether the document should be validated.
*/
virtual void set_validate(bool val = true);
/** See set_validate()
* @returns Whether the parser will validate the XML file.
*/
virtual bool get_validate() const;
/** Set whether the parser will automatically substitute entity references with the text of the entities' definitions.
* For instance, this affects the text returned by ContentNode::get_content().
* By default, the parser will not substitute entities, so that you do not lose the entity reference information.
* @param val Whether entities will be substitued.
*/
virtual void set_substitute_entities(bool val = true);
/** See set_substitute_entities().
* @returns Whether entities will be substituted during parsing.
*/
virtual bool get_substitute_entities() const;
/** Parse an XML document from a file.
* @throw exception
* @param filename The path to the file.
*/
virtual void parse_file(const Glib::ustring& filename) = 0;
//TODO: In a future ABI-break, add a virtual void parse_memory_raw(const unsigned char* contents, size_type bytes_count);
/** Parse an XML document from a string.
* @throw exception
* @param contents The XML document as a string.
*/
virtual void parse_memory(const Glib::ustring& contents) = 0;
/** Parse an XML document from a stream.
* @throw exception
* @param in The stream.
*/
virtual void parse_stream(std::istream& in) = 0;
//TODO: Add stop_parser()/stop_parsing(), wrapping XmlStopParser()?
protected:
virtual void initialize_context();
virtual void release_underlying();
virtual void on_validity_error(const Glib::ustring& message);
virtual void on_validity_warning(const Glib::ustring& message);
virtual void handleException(const exception& e);
virtual void check_for_exception();
virtual void check_for_validity_messages();
static void callback_validity_error(void* ctx, const char* msg, ...);
static void callback_validity_warning(void* ctx, const char* msg, ...);
_xmlParserCtxt* context_;
exception* exception_;
Glib::ustring validate_error_;
Glib::ustring validate_warning_; //Built gradually - used in an exception at the end of parsing.
bool validate_;
bool substitute_entities_;
};
} // namespace xmlpp
#endif //__LIBXMLPP_PARSER_H
|