00001 // Filename: subStream.h 00002 // Created by: drose (02Aug02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef SUBSTREAM_H 00020 #define SUBSTREAM_H 00021 00022 #include "pandabase.h" 00023 #include "subStreamBuf.h" 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : ISubStream 00027 // Description : An istream object that presents a subwindow into 00028 // another istream. The first character read from this 00029 // stream will be the "start" character from the source 00030 // istream; just before the file pointer reaches the 00031 // "end" character, eof is returned. 00032 // 00033 // The source stream must be one that we can randomly 00034 // seek within. The resulting ISubStream will also 00035 // support arbitrary seeks. 00036 //////////////////////////////////////////////////////////////////// 00037 class EXPCL_PANDAEXPRESS ISubStream : public istream { 00038 public: 00039 INLINE ISubStream(); 00040 INLINE ISubStream(istream *source, streampos start, streampos end); 00041 00042 INLINE ISubStream &open(istream *source, streampos start, streampos end); 00043 INLINE ISubStream &close(); 00044 00045 private: 00046 SubStreamBuf _buf; 00047 }; 00048 00049 #include "subStream.I" 00050 00051 #endif 00052 00053