XML.hxx

Go to the documentation of this file.
00001 // XML.hxx: 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 #ifndef VCSN_XML_XML_HXX
00018 # define VCSN_XML_XML_HXX
00019 
00031 namespace vcsn
00032 {
00033   namespace xml
00034   {
00035 
00036     template<typename Saver, typename Conv>
00037     void XML::operator()(std::ostream& out, const Saver& s,
00038                          const Conv&) const
00039     {
00040       xercesc::XMLPlatformUtils::Initialize();
00041 
00042       typedef typename Saver::automaton_t automaton_t;
00043 
00044       xml_converter<automaton_t> xc(use_label_node_);
00045       xc.save(s.automaton(), out, name_);
00046 
00047       xercesc::XMLPlatformUtils::Terminate();
00048     }
00049 
00050 
00051     template <typename Loader>
00052     void
00053     XML::operator()(std::istream& in, Loader& l)
00054     {
00055       xercesc::XMLPlatformUtils::Initialize();
00056 
00057       typedef typename Loader::automaton_t automaton_t;
00058 
00059       xml_converter<automaton_t> xc(use_label_node_);
00060       xc.load(l.automaton(), in);
00061 
00062       xercesc::XMLPlatformUtils::Terminate();
00063     }
00064 
00065 
00066   } // !xml
00067 
00068 } // !vcsn
00069 
00070 
00071 #endif // ! VCSN_XML_XML_HXX

Generated on Sat Jul 29 17:13:13 2006 for Vaucanson by  doxygen 1.4.6