ios.hh

Go to the documentation of this file.
00001 // ios.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2004, 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_IOS_HH
00019 # define VCSN_XML_IOS_HH
00020 
00029 # include <xercesc/util/BinInputStream.hpp>
00030 # include <xercesc/sax/InputSource.hpp>
00031 # include <iostream>
00032 
00033 namespace vcsn
00034 {
00035     namespace xml
00036     {
00037       class BinCxxInputStream : public xercesc::BinInputStream
00038       {
00039       private:
00040         std::istream* _in;
00041         unsigned int _pos;
00042 
00043       public:
00044         BinCxxInputStream(std::istream* in) : _in(in), _pos(0) { }
00045         virtual unsigned int curPos() const;
00046         virtual unsigned readBytes (XMLByte *const toFill,
00047                                     const unsigned int maxToRead);
00048       };
00049 
00050       class CxxInputSource : public xercesc::InputSource
00051       {
00052       private:
00053         std::istream* _in;
00054 
00055       public:
00056         CxxInputSource(std::istream* in) : InputSource(), _in(in) {}
00057         virtual BinCxxInputStream* makeStream() const;
00058       };
00059     }
00060 }
00061 
00062 # include <vaucanson/xml/ios.hxx>
00063 
00064 #endif // ! VCSN_XML_IOS_HH

Generated on Thu Oct 9 20:22:35 2008 for Vaucanson by  doxygen 1.5.1