Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkBase64Utilities.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkBase64Utilities.h,v $
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 =========================================================================*/
00031 #ifndef __vtkBase64Utilities_h
00032 #define __vtkBase64Utilities_h
00033 
00034 #include "vtkObject.h"
00035 
00036 class VTK_IO_EXPORT vtkBase64Utilities : public vtkObject
00037 {
00038 public:
00039   static vtkBase64Utilities *New();
00040   vtkTypeRevisionMacro(vtkBase64Utilities,vtkObject);
00041 
00043 
00044   static void EncodeTriplet(unsigned char i0,
00045                             unsigned char i1,
00046                             unsigned char i2,
00047                             unsigned char *o0,
00048                             unsigned char *o1,
00049                             unsigned char *o2,
00050                             unsigned char *o3);
00052 
00054 
00055   static void EncodePair(unsigned char i0,
00056                          unsigned char i1,
00057                          unsigned char *o0,
00058                          unsigned char *o1,
00059                          unsigned char *o2,
00060                          unsigned char *o3);
00062 
00064 
00065   static void EncodeSingle(unsigned char i0,
00066                            unsigned char *o0,
00067                            unsigned char *o1,
00068                            unsigned char *o2,
00069                            unsigned char *o3);
00071 
00073 
00083   static unsigned long Encode(const unsigned char *input, 
00084                               unsigned long length, 
00085                               unsigned char *output,
00086                               int mark_end = 0);
00088 
00089 
00091 
00092   static int DecodeTriplet(unsigned char i0,
00093                            unsigned char i1,
00094                            unsigned char i2,
00095                            unsigned char i3,
00096                            unsigned char *o0,
00097                            unsigned char *o1,
00098                            unsigned char *o2);
00100 
00102 
00111   static unsigned long Decode(const unsigned char *input, 
00112                               unsigned long length, 
00113                               unsigned char *output,
00114                               unsigned long max_input_length = 0);
00116 
00117 protected:
00118   vtkBase64Utilities() {};
00119   ~vtkBase64Utilities() {};  
00120   
00121 private:
00122   vtkBase64Utilities(const vtkBase64Utilities&);  // Not implemented.
00123   void operator=(const vtkBase64Utilities&);  // Not implemented.
00124 };
00125 
00126 #endif