VTK  9.1.0
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=========================================================================*/
23#ifndef vtkBase64OutputStream_h
24#define vtkBase64OutputStream_h
25
26#include "vtkIOCoreModule.h" // For export macro
27#include "vtkOutputStream.h"
28
29class VTKIOCORE_EXPORT vtkBase64OutputStream : public vtkOutputStream
30{
31public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
41 int StartWriting() override;
42
46 int Write(void const* data, size_t length) override;
47
54 int EndWriting() override;
55
56protected:
59
60 // Number of un-encoded bytes left in Buffer from last call to Write.
61 unsigned int BufferLength;
62 unsigned char Buffer[2];
63
64 // Methods to encode and write data.
65 int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2);
66 int EncodeEnding(unsigned char c0, unsigned char c1);
67 int EncodeEnding(unsigned char c0);
68
69private:
71 void operator=(const vtkBase64OutputStream&) = delete;
72};
73
74#endif
Writes base64-encoded output to a stream.
int StartWriting() override
Called after the stream position has been set by the caller, but before any Write calls.
int Write(void const *data, size_t length) override
Write output data of the given length.
static vtkBase64OutputStream * New()
~vtkBase64OutputStream() override
int EndWriting() override
Called after all desired calls to Write have been made.
int EncodeEnding(unsigned char c0, unsigned char c1)
int EncodeEnding(unsigned char c0)
int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:113
Wraps a binary output stream with a VTK interface.
@ length
Definition: vtkX3D.h:399
@ data
Definition: vtkX3D.h:321