VTK
vtkBase64InputStream.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBase64InputStream.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef __vtkBase64InputStream_h
23 #define __vtkBase64InputStream_h
24 
25 #include "vtkInputStream.h"
26 
28 {
29 public:
31  static vtkBase64InputStream *New();
32  void PrintSelf(ostream& os, vtkIndent indent);
33 
37  void StartReading();
38 
41  int Seek(unsigned long offset);
42 
44  unsigned long Read(unsigned char* data, unsigned long length);
45 
47 
51  void EndReading();
52 protected:
56 
57  // Number of decoded bytes left in Buffer from last call to Read.
59  unsigned char Buffer[2];
60 
61  // Reads 4 bytes from the input stream and decodes them into 3 bytes.
62  int DecodeTriplet(unsigned char& c0, unsigned char& c1, unsigned char& c2);
63 
64 private:
65  vtkBase64InputStream(const vtkBase64InputStream&); // Not implemented.
66  void operator=(const vtkBase64InputStream&); // Not implemented.
67 };
68 
69 #endif