VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkOutputStream.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 vtkOutputStream_h 00027 #define vtkOutputStream_h 00028 00029 #include "vtkIOCoreModule.h" // For export macro 00030 #include "vtkObject.h" 00031 00032 class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject 00033 { 00034 public: 00035 vtkTypeMacro(vtkOutputStream,vtkObject); 00036 static vtkOutputStream *New(); 00037 void PrintSelf(ostream& os, vtkIndent indent); 00038 00039 //BTX 00041 00042 vtkSetMacro(Stream, ostream*); 00043 vtkGetMacro(Stream, ostream*); 00044 //ETX 00046 00050 virtual int StartWriting(); 00051 00053 virtual int Write(void const* data, size_t length); 00054 00059 virtual int EndWriting(); 00060 00061 protected: 00062 vtkOutputStream(); 00063 ~vtkOutputStream(); 00064 00065 // The real output stream. 00066 ostream* Stream; 00067 int WriteStream(const char* data, size_t length); 00068 00069 private: 00070 vtkOutputStream(const vtkOutputStream&); // Not implemented. 00071 void operator=(const vtkOutputStream&); // Not implemented. 00072 }; 00073 00074 #endif