VTK  9.2.6
vtkBase64Utilities.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBase64Utilities.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 =========================================================================*/
25 #ifndef vtkBase64Utilities_h
26 #define vtkBase64Utilities_h
27 
28 #include "vtkIOCoreModule.h" // For export macro
29 #include "vtkObject.h"
30 
31 class VTKIOCORE_EXPORT vtkBase64Utilities : public vtkObject
32 {
33 public:
34  static vtkBase64Utilities* New();
35  vtkTypeMacro(vtkBase64Utilities, vtkObject);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
41  static void EncodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char* o0,
42  unsigned char* o1, unsigned char* o2, unsigned char* o3);
43 
47  static void EncodePair(unsigned char i0, unsigned char i1, unsigned char* o0, unsigned char* o1,
48  unsigned char* o2, unsigned char* o3);
49 
53  static void EncodeSingle(
54  unsigned char i0, unsigned char* o0, unsigned char* o1, unsigned char* o2, unsigned char* o3);
55 
69  static unsigned long Encode(
70  const unsigned char* input, unsigned long length, unsigned char* output, int mark_end = 0);
71 
76  static int DecodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3,
77  unsigned char* o0, unsigned char* o1, unsigned char* o2);
78 
88  static size_t DecodeSafely(
89  const unsigned char* input, size_t inputLen, unsigned char* output, size_t outputLen);
90 
91 protected:
92  vtkBase64Utilities() = default;
93  ~vtkBase64Utilities() override = default;
94 
95 private:
96  vtkBase64Utilities(const vtkBase64Utilities&) = delete;
97  void operator=(const vtkBase64Utilities&) = delete;
98 };
99 
100 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
base64 encode and decode utilities.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...