DOLFIN
DOLFIN C++ interface
xmlutils.h
1 // Copyright (C) 2011 Anders Logg
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2011-09-15
19 // Last changed: 2011-09-15
20 
21 #ifndef __XML_UTILS_H
22 #define __XML_UTILS_H
23 
24 #include <string>
25 
26 namespace pugi
27 {
28  class xml_node;
29 }
30 
31 namespace dolfin
32 {
33 
34  namespace xmlutils
35  {
36  // This file provides a small number of utility functions that may be
37  // useful when parsing XML using pugixml.
38 
41  const pugi::xml_node get_node(const pugi::xml_node& xml_node,
42  std::string node_name);
43 
44  // Check that xml_node has name 'name'. If not, throw error.
45  void check_node_name(const pugi::xml_node& xml_node,
46  const std::string name);
47 
48  // Check that xml_node has attribute 'name'. If not, throw error.
49  void check_has_attribute(const pugi::xml_node& xml_node,
50  const std::string name);
51  }
52 
53 }
54 
55 #endif
Definition: adapt.h:29
Definition: VTKFile.h:27