ios.hh

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 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 
00021 # include <xercesc/util/BinInputStream.hpp>
00022 # include <xercesc/sax/InputSource.hpp>
00023 # include <iostream>
00024 
00025 namespace vcsn
00026 {
00027     namespace xml
00028     {
00029       class BinCxxInputStream : public xercesc::BinInputStream
00030       {
00031       private:
00032         std::istream* _in;
00033         unsigned int _pos;
00034 
00035       public:
00036         BinCxxInputStream(std::istream* in) : _in(in), _pos(0) { }
00037         virtual unsigned int curPos() const;
00038         virtual unsigned readBytes (XMLByte *const toFill,
00039                                     const unsigned int maxToRead);
00040       };
00041 
00042       class CxxInputSource : public xercesc::InputSource
00043       {
00044       private:
00045         std::istream* _in;
00046 
00047       public:
00048         CxxInputSource(std::istream* in) : InputSource(), _in(in) {}
00049         virtual BinCxxInputStream* makeStream() const;
00050       };
00051     }
00052 }
00053 
00054 # include <vaucanson/xml/ios.hxx>
00055 
00056 #endif // ! VCSN_XML_IOS_HH

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