Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/IO/vtkInputStream.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInputStream.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00030 #ifndef __vtkInputStream_h
00031 #define __vtkInputStream_h
00032 
00033 #include "vtkObject.h"
00034 
00035 class VTK_IO_EXPORT vtkInputStream : public vtkObject
00036 {
00037 public:
00038   vtkTypeRevisionMacro(vtkInputStream,vtkObject);
00039   static vtkInputStream *New();
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041   
00042   //BTX
00044 
00045   vtkSetMacro(Stream, istream*);
00046   vtkGetMacro(Stream, istream*);
00047   //ETX
00049   
00053   virtual void StartReading();
00054   
00057   virtual int Seek(unsigned long offset);
00058   
00060 
00061   virtual unsigned long Read(unsigned char* data, unsigned long length);
00062   unsigned long Read(char* data, unsigned long length);
00064   
00069   virtual void EndReading();
00070   
00071 protected:
00072   vtkInputStream();
00073   ~vtkInputStream();  
00074   
00075   // The real input stream.
00076   istream* Stream;
00077   
00078   // The input stream's position when StartReading was called.
00079   unsigned long StreamStartPosition;
00080   
00081 private:
00082   vtkInputStream(const vtkInputStream&);  // Not implemented.
00083   void operator=(const vtkInputStream&);  // Not implemented.
00084 };
00085 
00086 #endif