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

dox/IO/vtkBase64InputStream.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkBase64InputStream.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 =========================================================================*/ 00026 #ifndef __vtkBase64InputStream_h 00027 #define __vtkBase64InputStream_h 00028 00029 #include "vtkInputStream.h" 00030 00031 class VTK_IO_EXPORT vtkBase64InputStream : public vtkInputStream 00032 { 00033 public: 00034 vtkTypeRevisionMacro(vtkBase64InputStream,vtkInputStream); 00035 static vtkBase64InputStream *New(); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00037 00041 void StartReading(); 00042 00045 int Seek(unsigned long offset); 00046 00048 unsigned long Read(unsigned char* data, unsigned long length); 00049 00054 void EndReading(); 00055 protected: 00056 vtkBase64InputStream(); 00057 ~vtkBase64InputStream(); 00058 00059 // Number of decoded bytes left in Buffer from last call to Read. 00060 int BufferLength; 00061 unsigned char Buffer[2]; 00062 00063 // Reads 4 bytes from the input stream and decodes them into 3 bytes. 00064 int DecodeTriplet(unsigned char& c0, unsigned char& c1, unsigned char& c2); 00065 00066 private: 00067 vtkBase64InputStream(const vtkBase64InputStream&); // Not implemented. 00068 void operator=(const vtkBase64InputStream&); // Not implemented. 00069 }; 00070 00071 #endif