VTK: IO/Core/vtkBase64Utilities.h Source File

| VTK 9.3.1

vtkBase64Utilities.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
13 #ifndef vtkBase64Utilities_h
14 #define vtkBase64Utilities_h
15
16 #include "vtkIOCoreModule.h" // For export macro
17 #include "vtkObject.h"
18
19 VTK_ABI_NAMESPACE_BEGIN
20 class VTKIOCORE_EXPORT vtkBase64Utilities : public vtkObject
21 {
22 public:
23 static vtkBase64Utilities* New();
24 vtkTypeMacro(vtkBase64Utilities, vtkObject);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
30 static void EncodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char* o0,
31 unsigned char* o1, unsigned char* o2, unsigned char* o3);
32
36 static void EncodePair(unsigned char i0, unsigned char i1, unsigned char* o0, unsigned char* o1,
37 unsigned char* o2, unsigned char* o3);
38
42 static void EncodeSingle(
43 unsigned char i0, unsigned char* o0, unsigned char* o1, unsigned char* o2, unsigned char* o3);
44
58 static unsigned long Encode(
59 const unsigned char* input, unsigned long length, unsigned char* output, int mark_end = 0);
60
65 static int DecodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3,
66 unsigned char* o0, unsigned char* o1, unsigned char* o2);
67
77 static size_t DecodeSafely(
78 const unsigned char* input, size_t inputLen, unsigned char* output, size_t outputLen);
79
80 protected:
81 vtkBase64Utilities() = default;
82 ~vtkBase64Utilities() override = default;
83
84 private:
85 vtkBase64Utilities(const vtkBase64Utilities&) = delete;
86 void operator=(const vtkBase64Utilities&) = delete;
87 };
88
89 VTK_ABI_NAMESPACE_END
90 #endif
vtkBase64Utilities
base64 encode and decode utilities.
Definition: vtkBase64Utilities.h:21
vtkBase64Utilities::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBase64Utilities::DecodeTriplet
static int DecodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3, unsigned char *o0, unsigned char *o1, unsigned char *o2)
Decode 4 bytes into 3 bytes.
vtkBase64Utilities::EncodeTriplet
static void EncodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
Encode 3 bytes into 4 bytes.
vtkBase64Utilities::DecodeSafely
static size_t DecodeSafely(const unsigned char *input, size_t inputLen, unsigned char *output, size_t outputLen)
Decode 4 bytes at a time from the input buffer and store the decoded stream into the output buffer.
vtkBase64Utilities::New
static vtkBase64Utilities * New()
vtkBase64Utilities::Encode
static unsigned long Encode(const unsigned char *input, unsigned long length, unsigned char *output, int mark_end=0)
Encode 'length' bytes from the input buffer and store the encoded stream into the output buffer.
vtkBase64Utilities::vtkBase64Utilities
vtkBase64Utilities()=default
vtkBase64Utilities::~vtkBase64Utilities
~vtkBase64Utilities() override=default
vtkBase64Utilities::EncodeSingle
static void EncodeSingle(unsigned char i0, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
Encode 1 byte into 4 bytes.
vtkBase64Utilities::EncodePair
static void EncodePair(unsigned char i0, unsigned char i1, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
Encode 2 bytes into 4 bytes.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkObject.h