VTK
|
base64 encode and decode utilities. More...
#include <vtkBase64Utilities.h>
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkBase64Utilities * | NewInstance () const |
Static Public Member Functions | |
static vtkBase64Utilities * | New () |
static int | IsTypeOf (const char *type) |
static vtkBase64Utilities * | SafeDownCast (vtkObjectBase *o) |
static void | EncodeTriplet (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3) |
static void | EncodePair (unsigned char i0, unsigned char i1, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3) |
static void | EncodeSingle (unsigned char i0, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3) |
static unsigned long | Encode (const unsigned char *input, unsigned long length, unsigned char *output, int mark_end=0) |
static int | DecodeTriplet (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3, unsigned char *o0, unsigned char *o1, unsigned char *o2) |
static unsigned long | Decode (const unsigned char *input, unsigned long length, unsigned char *output, unsigned long max_input_length=0) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkBase64Utilities () | |
~vtkBase64Utilities () |
base64 encode and decode utilities.
vtkBase64Utilities implements base64 encoding and decoding.
Definition at line 27 of file vtkBase64Utilities.h.
Reimplemented from vtkObject.
Definition at line 31 of file vtkBase64Utilities.h.
vtkBase64Utilities::vtkBase64Utilities | ( | ) | [inline, protected] |
Definition at line 109 of file vtkBase64Utilities.h.
vtkBase64Utilities::~vtkBase64Utilities | ( | ) | [inline, protected] |
Definition at line 110 of file vtkBase64Utilities.h.
static vtkBase64Utilities* vtkBase64Utilities::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
static int vtkBase64Utilities::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
virtual int vtkBase64Utilities::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
static vtkBase64Utilities* vtkBase64Utilities::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkObject.
virtual vtkObjectBase* vtkBase64Utilities::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkObject.
Reimplemented from vtkObject.
static void vtkBase64Utilities::EncodeTriplet | ( | unsigned char | i0, |
unsigned char | i1, | ||
unsigned char | i2, | ||
unsigned char * | o0, | ||
unsigned char * | o1, | ||
unsigned char * | o2, | ||
unsigned char * | o3 | ||
) | [static] |
Encode 3 bytes into 4 bytes
static void vtkBase64Utilities::EncodePair | ( | unsigned char | i0, |
unsigned char | i1, | ||
unsigned char * | o0, | ||
unsigned char * | o1, | ||
unsigned char * | o2, | ||
unsigned char * | o3 | ||
) | [static] |
Encode 2 bytes into 4 bytes
static void vtkBase64Utilities::EncodeSingle | ( | unsigned char | i0, |
unsigned char * | o0, | ||
unsigned char * | o1, | ||
unsigned char * | o2, | ||
unsigned char * | o3 | ||
) | [static] |
Encode 1 byte into 4 bytes
static unsigned long vtkBase64Utilities::Encode | ( | const unsigned char * | input, |
unsigned long | length, | ||
unsigned char * | output, | ||
int | mark_end = 0 |
||
) | [static] |
Encode 'length' bytes from the input buffer and store the encoded stream into the output buffer. Return the length of the encoded stream. Note that the output buffer must be allocated by the caller (length * 1.5 should be a safe estimate). If 'mark_end' is true than an extra set of 4 bytes is added to the end of the stream if the input is a multiple of 3 bytes. These bytes are invalid chars and therefore they will stop the decoder thus enabling the caller to decode a stream without actually knowing how much data to expect (if the input is not a multiple of 3 bytes then the extra padding needed to complete the encode 4 bytes will stop the decoding anyway).
static int vtkBase64Utilities::DecodeTriplet | ( | unsigned char | i0, |
unsigned char | i1, | ||
unsigned char | i2, | ||
unsigned char | i3, | ||
unsigned char * | o0, | ||
unsigned char * | o1, | ||
unsigned char * | o2 | ||
) | [static] |
Decode 4 bytes into 3 bytes.
static unsigned long vtkBase64Utilities::Decode | ( | const unsigned char * | input, |
unsigned long | length, | ||
unsigned char * | output, | ||
unsigned long | max_input_length = 0 |
||
) | [static] |
Decode bytes from the input buffer and store the decoded stream into the output buffer until 'length' bytes have been decoded. Return the real length of the decoded stream (which should be equal to 'length'). Note that the output buffer must be allocated by the caller. If 'max_input_length' is not null, then it specifies the number of encoded bytes that should be at most read from the input buffer. In that case the 'length' parameter is ignored. This enables the caller to decode a stream without actually knowing how much decoded data to expect (of course, the buffer must be large enough).