Vaucanson  1.4.1
tools.hh
Go to the documentation of this file.
1 // tools.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2007, 2008 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 
18 #ifndef VCSN_XML_TOOLS_HH
19 # define VCSN_XML_TOOLS_HH
20 
31 # include <string>
32 
33 # include <xercesc/sax2/Attributes.hpp>
34 # include <xercesc/util/XMLString.hpp>
35 # include <xercesc/dom/DOM.hpp>
36 
37 namespace vcsn
38 {
39  namespace xml
40  {
41  namespace tools
42  {
46  bool
47  has_attribute (const xercesc::Attributes& attrs,
48  const char* key,
49  const XMLCh* const uri = 0);
50 
51  bool
52  has_attribute (const xercesc::Attributes& attrs,
53  const XMLCh* xkey,
54  const XMLCh* const uri = 0);
55 
56  const XMLCh*
57  get_attribute (const xercesc::Attributes& attrs,
58  const char* key,
59  const XMLCh* uri = 0);
60 
61  const XMLCh*
62  get_attribute (const xercesc::Attributes& attrs,
63  const XMLCh* xkey,
64  const XMLCh* uri = 0);
65 
69  void
70  set_attribute (xercesc::DOMElement* e,
71  const std::string& k, const std::string& v);
75  xercesc::DOMElement*
76  create_element(xercesc::DOMDocument* doc,
77  const std::string& e);
78  } // !tools
79  } // !xml
80 } // !vcsn
81 
82 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
83 # include <vaucanson/xml/tools.hxx>
84 # endif // VCSN_USE_INTERFACE_ONLY || !VCSN_USE_LIB
85 
86 #endif // !VCSN_XML_TOOLS_HH