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

vtkBase64InputStream.h

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