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