VTK: IO/Core/vtkBase64InputStream.h Source File

| VTK 9.3.1

vtkBase64InputStream.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 vtkBase64InputStream_h
12 #define vtkBase64InputStream_h
13
14 #include "vtkIOCoreModule.h" // For export macro
15 #include "vtkInputStream.h"
16
17 VTK_ABI_NAMESPACE_BEGIN
18 class VTKIOCORE_EXPORT vtkBase64InputStream : public vtkInputStream
19 {
20 public:
21 vtkTypeMacro(vtkBase64InputStream, vtkInputStream);
22 static vtkBase64InputStream* New();
23 void PrintSelf(ostream& os, vtkIndent indent) override;
24
30 void StartReading() override;
31
36 int Seek(vtkTypeInt64 offset) override;
37
42 size_t Read(void* data, size_t length) override;
43
50 void EndReading() override;
51
52 protected:
53 vtkBase64InputStream();
54 ~vtkBase64InputStream() override;
55
56 // Number of decoded bytes left in Buffer from last call to Read.
57 int BufferLength;
58 unsigned char Buffer[2];
59
60 // Reads 4 bytes from the input stream and decodes them into 3 bytes.
61 int DecodeTriplet(unsigned char& c0, unsigned char& c1, unsigned char& c2);
62
63 private:
64 vtkBase64InputStream(const vtkBase64InputStream&) = delete;
65 void operator=(const vtkBase64InputStream&) = delete;
66 };
67
68 VTK_ABI_NAMESPACE_END
69 #endif
vtkBase64InputStream
Reads base64-encoded input from a stream.
Definition: vtkBase64InputStream.h:19
vtkBase64InputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBase64InputStream::New
static vtkBase64InputStream * New()
vtkBase64InputStream::DecodeTriplet
int DecodeTriplet(unsigned char &c0, unsigned char &c1, unsigned char &c2)
vtkBase64InputStream::StartReading
void StartReading() override
Called after the stream position has been set by the caller, but before any Seek or Read calls.
vtkBase64InputStream::Seek
int Seek(vtkTypeInt64 offset) override
Seek to the given offset in the input data.
vtkBase64InputStream::EndReading
void EndReading() override
Called after all desired calls to Seek and Read have been made.
vtkBase64InputStream::vtkBase64InputStream
vtkBase64InputStream()
vtkBase64InputStream::Read
size_t Read(void *data, size_t length) override
Read input data of the given length.
vtkBase64InputStream::BufferLength
int BufferLength
Definition: vtkBase64InputStream.h:57
vtkBase64InputStream::~vtkBase64InputStream
~vtkBase64InputStream() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInputStream
Wraps a binary input stream with a VTK interface.
Definition: vtkInputStream.h:23
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkX3D::offset
@ offset
Definition: vtkX3D.h:438
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkInputStream.h