H3D API  2.4.1
IStreamInputStream.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
26 //
28 
29 #ifndef __ISTREAMINPUTSTREAM_H__
30 #define __ISTREAMINPUTSTREAM_H__
31 
32 #include <H3D/H3DApi.h>
33 
34 #ifdef HAVE_XERCES
35 #include <xercesc/util/BinInputStream.hpp>
36 #include <iostream>
37 
38 XERCES_CPP_NAMESPACE_USE
39 
40 namespace H3D {
41  namespace X3D {
44  class IStreamInputStream : public BinInputStream {
45  public :
47  IStreamInputStream ( istream &_is ) : is( _is ), total_count( 0 ) {}
48 
49 #if(XERCES_VERSION_MAJOR > 2 )
50  virtual XMLFilePos curPos() const;
51 
52  virtual XMLSize_t readBytes( XMLByte* const toFill,
53  const XMLSize_t maxToRead );
54 
55  virtual const XMLCh* getContentType() const {
56  return 0;
57  }
58 #else
59  virtual unsigned int curPos() const;
60 
61  virtual unsigned int readBytes( XMLByte* const toFill,
62  const unsigned int maxToRead );
63 
64 #endif
65 
66  protected :
67  //BinFileInputStream(const BinFileInputStream&);
68  // BinFileInputStream& operator=(const BinFileInputStream&);
69 
70  istream &is;
71  unsigned int total_count;
72 
73  };
74  }
75 }
76 
77 #endif
78 #endif
Base header file that handles all configuration related settings.
This class implements the BinInputStream interface to read from a istream.
Definition: IStreamInputStream.h:44
IStreamInputStream(istream &_is)
Constructor.
Definition: IStreamInputStream.h:47
H3D API namespace.
Definition: Anchor.h:38