Vaucanson  1.4.1
XML.hh
Go to the documentation of this file.
1 // XML.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2005, 2006 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_XML_HH
19 # define VCSN_XML_XML_HH
20 
31 # include <string>
32 # include <iostream>
33 
34 
35 
36 namespace vcsn
37 {
38  namespace tools
39  {
40  template <typename Auto, typename T, typename Format>
41  struct automaton_saver_;
42 
43  template <typename RE, typename T, typename Format>
44  struct regexp_saver_;
45 
46  template <typename Auto, typename T, typename Format>
47  struct automaton_loader_;
48 
49  template <typename RE, typename T, typename Format>
50  struct regexp_loader_;
51  } // !tools
52 
53  namespace xml
54  {
55 
56  class XML
57  {
58  public:
59  XML(const std::string& name = "");
60  XML(const XML& old);
61  ~XML();
62 
66  template <typename Auto, typename T, typename Format, typename Conv>
67  void operator()(std::ostream& out,
68  const vcsn::tools::automaton_saver_<Auto, T, Format>& s,
69  const Conv& conv) const;
70 
74  template <typename RE, typename T, typename Format, typename Conv>
75  void operator()(std::ostream& out,
76  const vcsn::tools::regexp_saver_<RE, T, Format>& s,
77  const Conv& conv) const;
78 
82  template <typename Auto, typename T, typename Format>
83  void operator()(std::istream& in, vcsn::tools::automaton_loader_<Auto, T, Format>& l, bool check = true);
84 
88  template <typename RE, typename T, typename Format>
89  void operator()(std::istream& in, vcsn::tools::regexp_loader_<RE, T, Format>& l, bool check = true);
90 
91 
96  static int inst_;
97  protected:
98  const std::string name_;
99  };
100  } // !xml
101 } // !vcsn
102 
103 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
104 # include <vaucanson/xml/XML.hxx>
105 # endif // VCSN_USE_INTERFACE_ONLY
106 
107 #endif // ! VCSN_XML_XML_HH