Vaucanson 1.4
XML.hh
Go to the documentation of this file.
00001 // XML.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2005, 2006 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 
00018 #ifndef VCSN_XML_XML_HH
00019 # define VCSN_XML_XML_HH
00020 
00031 # include <string>
00032 # include <iostream>
00033 
00034 
00035 
00036 namespace vcsn
00037 {
00038   namespace tools
00039   {
00040     template <typename Auto, typename T, typename Format>
00041     struct automaton_saver_;
00042 
00043     template <typename RE, typename T, typename Format>
00044     struct regexp_saver_;
00045 
00046     template <typename Auto, typename T, typename Format>
00047     struct automaton_loader_;
00048 
00049     template <typename RE, typename T, typename Format>
00050     struct regexp_loader_;
00051   } // !tools
00052 
00053   namespace xml
00054   {
00055 
00056     class XML
00057     {
00058       public:
00059         XML(const std::string& name = "");
00060         XML(const XML& old);
00061         ~XML();
00062 
00066         template <typename Auto, typename T, typename Format, typename Conv>
00067         void operator()(std::ostream& out,
00068                         const vcsn::tools::automaton_saver_<Auto, T, Format>& s,
00069                         const Conv& conv) const;
00070 
00074         template <typename RE, typename T, typename Format, typename Conv>
00075         void operator()(std::ostream& out,
00076                         const vcsn::tools::regexp_saver_<RE, T, Format>& s,
00077                         const Conv& conv) const;
00078 
00082         template <typename Auto, typename T, typename Format>
00083         void operator()(std::istream& in, vcsn::tools::automaton_loader_<Auto, T, Format>& l, bool check = true);
00084 
00088         template <typename RE, typename T, typename Format>
00089         void operator()(std::istream& in, vcsn::tools::regexp_loader_<RE, T, Format>& l, bool check = true);
00090 
00091 
00096         static int inst_;
00097       protected:
00098         const   std::string name_;
00099     };
00100   } // !xml
00101 } // !vcsn
00102 
00103 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00104 #  include <vaucanson/xml/XML.hxx>
00105 # endif // VCSN_USE_INTERFACE_ONLY
00106 
00107 #endif // ! VCSN_XML_XML_HH