VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBase64Utilities.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00021 #ifndef __vtkBase64Utilities_h 00022 #define __vtkBase64Utilities_h 00023 00024 #include "vtkIOCoreModule.h" // For export macro 00025 #include "vtkObject.h" 00026 00027 class VTKIOCORE_EXPORT vtkBase64Utilities : public vtkObject 00028 { 00029 public: 00030 static vtkBase64Utilities *New(); 00031 vtkTypeMacro(vtkBase64Utilities,vtkObject); 00032 00034 00035 static void EncodeTriplet(unsigned char i0, 00036 unsigned char i1, 00037 unsigned char i2, 00038 unsigned char *o0, 00039 unsigned char *o1, 00040 unsigned char *o2, 00041 unsigned char *o3); 00043 00045 00046 static void EncodePair(unsigned char i0, 00047 unsigned char i1, 00048 unsigned char *o0, 00049 unsigned char *o1, 00050 unsigned char *o2, 00051 unsigned char *o3); 00053 00055 00056 static void EncodeSingle(unsigned char i0, 00057 unsigned char *o0, 00058 unsigned char *o1, 00059 unsigned char *o2, 00060 unsigned char *o3); 00062 00064 00074 static unsigned long Encode(const unsigned char *input, 00075 unsigned long length, 00076 unsigned char *output, 00077 int mark_end = 0); 00079 00080 00082 00083 static int DecodeTriplet(unsigned char i0, 00084 unsigned char i1, 00085 unsigned char i2, 00086 unsigned char i3, 00087 unsigned char *o0, 00088 unsigned char *o1, 00089 unsigned char *o2); 00091 00093 00102 static unsigned long Decode(const unsigned char *input, 00103 unsigned long length, 00104 unsigned char *output, 00105 unsigned long max_input_length = 0); 00107 00108 protected: 00109 vtkBase64Utilities() {}; 00110 ~vtkBase64Utilities() {}; 00111 00112 private: 00113 vtkBase64Utilities(const vtkBase64Utilities&); // Not implemented. 00114 void operator=(const vtkBase64Utilities&); // Not implemented. 00115 }; 00116 00117 #endif 00118 // VTK-HeaderTest-Exclude: vtkBase64Utilities.h