VTK
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 =========================================================================*/
22 #ifndef vtkBase64Utilities_h
23 #define vtkBase64Utilities_h
24 
25 #include "vtkIOCoreModule.h" // For export macro
26 #include "vtkObject.h"
27 
28 class VTKIOCORE_EXPORT vtkBase64Utilities : public vtkObject
29 {
30 public:
31  static vtkBase64Utilities* New();
32  vtkTypeMacro(vtkBase64Utilities, vtkObject);
33 
37  static void EncodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char* o0,
38  unsigned char* o1, unsigned char* o2, unsigned char* o3);
39 
43  static void EncodePair(unsigned char i0, unsigned char i1, unsigned char* o0, unsigned char* o1,
44  unsigned char* o2, unsigned char* o3);
45 
49  static void EncodeSingle(
50  unsigned char i0, unsigned char* o0, unsigned char* o1, unsigned char* o2, unsigned char* o3);
51 
65  static unsigned long Encode(
66  const unsigned char* input, unsigned long length, unsigned char* output, int mark_end = 0);
67 
72  static int DecodeTriplet(unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3,
73  unsigned char* o0, unsigned char* o1, unsigned char* o2);
74 
84  static size_t DecodeSafely(
85  const unsigned char* input, size_t inputLen, unsigned char* output, size_t outputLen);
86 
87 protected:
89  ~vtkBase64Utilities() override {}
90 
91 private:
92  vtkBase64Utilities(const vtkBase64Utilities&) = delete;
93  void operator=(const vtkBase64Utilities&) = delete;
94 };
95 
96 #endif
97 // VTK-HeaderTest-Exclude: vtkBase64Utilities.h
vtkBase64Utilities::vtkBase64Utilities
vtkBase64Utilities()
Definition: vtkBase64Utilities.h:88
vtkBase64Utilities
base64 encode and decode utilities.
Definition: vtkBase64Utilities.h:28
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkX3D::length
Definition: vtkX3D.h:399
vtkBase64Utilities::~vtkBase64Utilities
~vtkBase64Utilities() override
Definition: vtkBase64Utilities.h:89
vtkObject.h