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

vtkInputStream.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInputStream.h,v $
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 =========================================================================*/
00036 #ifndef __vtkInputStream_h
00037 #define __vtkInputStream_h
00038 
00039 #include "vtkObject.h"
00040 
00041 class VTK_IO_EXPORT vtkInputStream : public vtkObject
00042 {
00043 public:
00044   vtkTypeRevisionMacro(vtkInputStream,vtkObject);
00045   static vtkInputStream *New();
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047   
00048   //BTX
00050 
00051   vtkSetMacro(Stream, istream*);
00052   vtkGetMacro(Stream, istream*);
00053   //ETX
00055   
00059   virtual void StartReading();
00060   
00063   virtual int Seek(unsigned long offset);
00064   
00066 
00067   virtual unsigned long Read(unsigned char* data, unsigned long length);
00068   unsigned long Read(char* data, unsigned long length);
00070   
00075   virtual void EndReading();
00076   
00077 protected:
00078   vtkInputStream();
00079   ~vtkInputStream();  
00080   
00081   // The real input stream.
00082   istream* Stream;
00083   
00084   // The input stream's position when StartReading was called.
00085   unsigned long StreamStartPosition;
00086   
00087 private:
00088   vtkInputStream(const vtkInputStream&);  // Not implemented.
00089   void operator=(const vtkInputStream&);  // Not implemented.
00090 };
00091 
00092 #endif