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:
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:
54  ~vtkBase64InputStream() override;
55 
56  // Number of decoded bytes left in Buffer from last call to Read.
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:
65  void operator=(const vtkBase64InputStream&) = delete;
66 };
67 
68 VTK_ABI_NAMESPACE_END
69 #endif
Reads base64-encoded input from a stream.
virtual void EndReading()
Called after all desired calls to Seek and Read have been made.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void StartReading()
Called after the stream position has been set by the caller, but before any Seek or Read calls...
Wraps a binary input stream with a VTK interface.
static vtkInputStream * New()
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual size_t Read(void *data, size_t length)
Read input data of the given length.
virtual int Seek(vtkTypeInt64 offset)
Seek to the given offset in the input data.