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 =========================================================================*/
23 #ifndef vtkBase64OutputStream_h
24 #define vtkBase64OutputStream_h
25 
26 #include "vtkIOCoreModule.h" // For export macro
27 #include "vtkOutputStream.h"
28 
29 class VTKIOCORE_EXPORT vtkBase64OutputStream : public vtkOutputStream
30 {
31 public:
33  static vtkBase64OutputStream* New();
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 
56 protected:
58  ~vtkBase64OutputStream() override;
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 
69 private:
71  void operator=(const vtkBase64OutputStream&) = delete;
72 };
73 
74 #endif
vtkBase64OutputStream
Writes base64-encoded output to a stream.
Definition: vtkBase64OutputStream.h:29
vtkX3D::data
Definition: vtkX3D.h:321
vtkOutputStream::StartWriting
virtual int StartWriting()
Called after the stream position has been set by the caller, but before any Write calls.
vtkBase64OutputStream::BufferLength
unsigned int BufferLength
Definition: vtkBase64OutputStream.h:61
vtkX3D::length
Definition: vtkX3D.h:399
vtkOutputStream::Write
virtual int Write(void const *data, size_t length)
Write output data of the given length.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkOutputStream::New
static vtkOutputStream * New()
vtkOutputStream::EndWriting
virtual int EndWriting()
Called after all desired calls to Write have been made.
vtkOutputStream
Wraps a binary output stream with a VTK interface.
Definition: vtkOutputStream.h:33
vtkOutputStream.h
vtkOutputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.