VTK
vtkBase64OutputStream.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBase64OutputStream.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 vtkBase64OutputStream_h
23 #define vtkBase64OutputStream_h
24 
25 #include "vtkIOCoreModule.h" // For export macro
26 #include "vtkOutputStream.h"
27 
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent);
34 
38  int StartWriting();
39 
41  int Write(void const* data, size_t length);
42 
47  int EndWriting();
48 
49 protected:
52 
53  // Number of un-encoded bytes left in Buffer from last call to Write.
54  unsigned int BufferLength;
55  unsigned char Buffer[2];
56 
57  // Methods to encode and write data.
58  int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2);
59  int EncodeEnding(unsigned char c0, unsigned char c1);
60  int EncodeEnding(unsigned char c0);
61 
62 private:
63  vtkBase64OutputStream(const vtkBase64OutputStream&); // Not implemented.
64  void operator=(const vtkBase64OutputStream&); // Not implemented.
65 };
66 
67 #endif
vtkBase64OutputStream
Writes base64-encoded output to a stream.
Definition: vtkBase64OutputStream.h:29
VTKIOCORE_EXPORT
#define VTKIOCORE_EXPORT
Definition: vtkIOCoreModule.h:15
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkBase64OutputStream::EndWriting
int EndWriting()
vtkIOCoreModule.h
vtkBase64OutputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkBase64OutputStream::EncodeEnding
int EncodeEnding(unsigned char c0)
vtkBase64OutputStream::~vtkBase64OutputStream
~vtkBase64OutputStream()
vtkBase64OutputStream::EncodeTriplet
int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2)
vtkBase64OutputStream::vtkBase64OutputStream
vtkBase64OutputStream()
vtkBase64OutputStream::Write
int Write(void const *data, size_t length)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkBase64OutputStream::BufferLength
unsigned int BufferLength
Definition: vtkBase64OutputStream.h:54
vtkBase64OutputStream::New
static vtkBase64OutputStream * New()
vtkgl::length
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkOutputStream
Wraps a binary output stream with a VTK interface.
Definition: vtkOutputStream.h:33
vtkOutputStream.h
vtkBase64OutputStream::StartWriting
int StartWriting()
vtkBase64OutputStream::EncodeEnding
int EncodeEnding(unsigned char c0, unsigned char c1)