1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2013 Index Data
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <libxml/tree.h>
26 namespace metaproxy_1 {
28 std::string get_text(const struct _xmlAttr *ptr);
29 std::string get_text(const xmlNode *ptr);
30 bool get_bool(const xmlNode *ptr, bool default_value);
31 int get_int(const xmlNode *ptr, int default_value);
33 void parse_attr(const xmlNode *node, const char **names,
35 bool check_attribute(const _xmlAttr *ptr,
36 const std::string &ns,
37 const std::string &name);
38 bool is_attribute(const _xmlAttr *ptr,
39 const std::string &ns,
40 const std::string &name);
41 bool is_element(const xmlNode *ptr,
42 const std::string &ns,
43 const std::string &name);
44 bool is_element_mp(const xmlNode *ptr, const std::string &name);
45 bool check_element_mp(const xmlNode *ptr,
46 const std::string &name);
47 std::string get_route(const xmlNode *node);
48 std::string get_route(const xmlNode *node, std::string &auth);
50 const xmlNode* jump_to(const xmlNode* node, int node_type);
52 const xmlNode* jump_to_next(const xmlNode* node, int node_type);
54 const xmlNode* jump_to_children(const xmlNode* node, int node_type);
56 void check_empty(const xmlNode *node);
58 std::string url_recipe_handle(xmlDoc *doc, std::string recipe);
60 class XMLError : public std::runtime_error {
62 XMLError(const std::string msg) :
63 std::runtime_error("XMLError : " + msg) {} ;
71 * c-file-style: "Stroustrup"
72 * indent-tabs-mode: nil
74 * vim: shiftwidth=4 tabstop=8 expandtab