00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VCSN_XML_XML_CHOOSER_HH
00019 # define VCSN_XML_XML_CHOOSER_HH
00020
00031 # include <string>
00032 # include <sstream>
00033 # include <xercesc/dom/DOM.hpp>
00034
00035 # include <vaucanson/design_pattern/element.hh>
00036 # include <vaucanson/misc/usual_macros.hh>
00037 # include <vaucanson/xml/tools.hh>
00038
00039
00040 namespace vcsn
00041 {
00042 namespace xml
00043 {
00051 template <class S, class T>
00052 struct xml_chooser_base
00053 {
00054 typedef typename T::hstate_t hstate_t;
00055 typedef typename T::htransition_t htransition_t;
00056
00057 void create_type_tag(const Element<S, T>& aut,
00058 xercesc::DOMDocument* doc,
00059 xercesc::DOMElement* root);
00060
00061 void create_label(xercesc::DOMDocument* doc,
00062 htransition_t e, const Element<S, T>&aut,
00063 xercesc::DOMElement* elt, bool use_label_node);
00064
00065 void create_initial_label(xercesc::DOMDocument* doc,
00066 hstate_t s, const Element<S, T>& aut,
00067 xercesc::DOMElement* elt,
00068 bool use_label_node);
00069 void create_final_label(xercesc::DOMDocument* doc,
00070 hstate_t s, const Element<S, T>& aut,
00071 xercesc::DOMElement* elt,
00072 bool use_label_node);
00073 };
00074
00082 template <class S, class T>
00083 struct xml_chooser : xml_chooser_base<S, T>
00084 {};
00085
00093 template <class S, class T>
00094 struct xml_chooser<Automata<S>, T> : xml_chooser_base<Automata<S>, T>
00095 {};
00096
00104 template <class S, class T>
00105 struct xml_chooser<Transducer<S>, T> : xml_chooser_base<Transducer<S>, T>
00106 {
00107 void create_type_tag(const Element<Transducer<S>, T>& aut,
00108 xercesc::DOMDocument* doc,
00109 xercesc::DOMElement* root);
00110 };
00111
00121 # define FMPtype \
00122 Automata< \
00123 vcsn::algebra::Series<S, vcsn::algebra::FreeMonoidProduct<M1, M2> > \
00124 >, T
00125
00126 template <class S, class T, class M1, class M2>
00127 struct xml_chooser<FMPtype> : xml_chooser_base<FMPtype>
00128 {
00129 void create_type_tag(const Element<FMPtype>& aut,
00130 xercesc::DOMDocument* doc,
00131 xercesc::DOMElement* root);
00132 };
00133
00134
00135 }
00136
00137 }
00138
00139 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00140 # include <vaucanson/xml/xml_chooser.hxx>
00141 # endif // VCSN_USE_INTERFACE_ONLY
00142
00143 # undef FMPtype
00144
00145 #endif // ! VCSN_XML_XML_CHOOSER_HH