18 #ifndef VCSN_XML_INTERNAL_IOS_HH
19 # define VCSN_XML_INTERNAL_IOS_HH
31 # include <xercesc/dom/DOM.hpp>
32 # include <xercesc/util/BinInputStream.hpp>
33 # include <xercesc/sax/InputSource.hpp>
34 # include <xercesc/framework/XMLFormatter.hpp>
37 # if (XERCES_VERSION_MAJOR == 2)
38 # define XMLSize_t unsigned int
39 # define XERCES_FILEPOS XMLSize_t
40 # elif (XERCES_VERSION_MAJOR > 2)
41 # define XERCES_FILEPOS XMLFilePos
43 # error "Unsupported Xerces-C++ major version (too old)."
46 XERCES_CPP_NAMESPACE_BEGIN
55 template<
class Ostream>
69 virtual void writeChars(
const XMLByte*
const toWrite,
73 virtual void flush() {};
85 XERCES_CPP_NAMESPACE_END
91 class BinCxxInputStream :
public xercesc::BinInputStream
98 BinCxxInputStream(std::istream* in) : _in(in), _pos(0) { }
99 virtual XERCES_FILEPOS curPos()
const;
100 virtual XMLSize_t readBytes(XMLByte *
const toFill,
101 const XMLSize_t maxToRead);
102 virtual const XMLCh* getContentType ()
const {
return 0; }
105 class CxxInputSource :
public xercesc::InputSource
111 CxxInputSource(std::istream* in) : InputSource(), _in(in) {}
112 virtual BinCxxInputStream* makeStream()
const;
115 void print_xml(std::ostream& out,
116 xercesc::DOMImplementation* impl,
117 xercesc::DOMElement* root);
123 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
124 # include <vaucanson/xml/internal/ios.hxx>
125 # endif // !VCSN_USE_INTERFACE_ONLY || VCSN_USE_LIB
127 #endif // ! VCSN_XML_IOS_HH