VTK: IO/Core/vtkBase64OutputStream.h Source File

| VTK 9.3.1

vtkBase64OutputStream.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkBase64OutputStream_h
12 #define vtkBase64OutputStream_h
13
14 #include "vtkIOCoreModule.h" // For export macro
15 #include "vtkOutputStream.h"
16
17 VTK_ABI_NAMESPACE_BEGIN
18 class VTKIOCORE_EXPORT vtkBase64OutputStream : public vtkOutputStream
19 {
20 public:
21 vtkTypeMacro(vtkBase64OutputStream, vtkOutputStream);
22 static vtkBase64OutputStream* New();
23 void PrintSelf(ostream& os, vtkIndent indent) override;
24
30 int StartWriting() override;
31
35 int Write(void const* data, size_t length) override;
36
43 int EndWriting() override;
44
45 protected:
46 vtkBase64OutputStream();
47 ~vtkBase64OutputStream() override;
48
49 // Number of un-encoded bytes left in Buffer from last call to Write.
50 unsigned int BufferLength;
51 unsigned char Buffer[2];
52
53 // Methods to encode and write data.
54 int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2);
55 int EncodeEnding(unsigned char c0, unsigned char c1);
56 int EncodeEnding(unsigned char c0);
57
58 private:
59 vtkBase64OutputStream(const vtkBase64OutputStream&) = delete;
60 void operator=(const vtkBase64OutputStream&) = delete;
61 };
62
63 VTK_ABI_NAMESPACE_END
64 #endif
vtkBase64OutputStream
Writes base64-encoded output to a stream.
Definition: vtkBase64OutputStream.h:19
vtkBase64OutputStream::StartWriting
int StartWriting() override
Called after the stream position has been set by the caller, but before any Write calls.
vtkBase64OutputStream::Write
int Write(void const *data, size_t length) override
Write output data of the given length.
vtkBase64OutputStream::New
static vtkBase64OutputStream * New()
vtkBase64OutputStream::~vtkBase64OutputStream
~vtkBase64OutputStream() override
vtkBase64OutputStream::vtkBase64OutputStream
vtkBase64OutputStream()
vtkBase64OutputStream::EndWriting
int EndWriting() override
Called after all desired calls to Write have been made.
vtkBase64OutputStream::EncodeEnding
int EncodeEnding(unsigned char c0, unsigned char c1)
vtkBase64OutputStream::BufferLength
unsigned int BufferLength
Definition: vtkBase64OutputStream.h:50
vtkBase64OutputStream::EncodeEnding
int EncodeEnding(unsigned char c0)
vtkBase64OutputStream::EncodeTriplet
int EncodeTriplet(unsigned char c0, unsigned char c1, unsigned char c2)
vtkBase64OutputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkOutputStream
Wraps a binary output stream with a VTK interface.
Definition: vtkOutputStream.h:23
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkOutputStream.h