Panda3D

subStream.h

00001 // Filename: subStream.h
00002 // Created by:  drose (02Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef SUBSTREAM_H
00016 #define SUBSTREAM_H
00017 
00018 #include "pandabase.h"
00019 #include "subStreamBuf.h"
00020 #include "streamWrapper.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : ISubStream
00024 // Description : An istream object that presents a subwindow into
00025 //               another istream.  The first character read from this
00026 //               stream will be the "start" character from the source
00027 //               istream; just before the file pointer reaches the
00028 //               "end" character, eof is returned.
00029 //
00030 //               The source stream must be one that we can randomly
00031 //               seek within.  The resulting ISubStream will also
00032 //               support arbitrary seeks.
00033 ////////////////////////////////////////////////////////////////////
00034 class EXPCL_PANDAEXPRESS ISubStream : public istream {
00035 PUBLISHED:
00036   INLINE ISubStream();
00037   INLINE ISubStream(IStreamWrapper *source, streampos start, streampos end);
00038 
00039   INLINE ISubStream &open(IStreamWrapper *source, streampos start, streampos end);
00040   INLINE ISubStream &close();
00041 
00042 private:
00043   SubStreamBuf _buf;
00044 };
00045 
00046 #include "subStream.I"
00047 
00048 #endif
00049 
00050 
 All Classes Functions Variables Enumerations