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 "vtkObject.h" 00030 00031 class VTK_IO_EXPORT vtkOutputStream : public vtkObject 00032 { 00033 public: 00034 vtkTypeMacro(vtkOutputStream,vtkObject); 00035 static vtkOutputStream *New(); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00037 00038 //BTX 00040 00041 vtkSetMacro(Stream, ostream*); 00042 vtkGetMacro(Stream, ostream*); 00043 //ETX 00045 00049 virtual int StartWriting(); 00050 00052 00053 virtual int Write(const unsigned char* data, unsigned long length); 00054 int Write(const char* data, unsigned long length); 00056 00061 virtual int EndWriting(); 00062 00063 protected: 00064 vtkOutputStream(); 00065 ~vtkOutputStream(); 00066 00067 // The real output stream. 00068 ostream* Stream; 00069 00070 private: 00071 vtkOutputStream(const vtkOutputStream&); // Not implemented. 00072 void operator=(const vtkOutputStream&); // Not implemented. 00073 }; 00074 00075 #endif