Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkBase64Utilities Class Reference

`#include <vtkBase64Utilities.h>`

Inheritance diagram for vtkBase64Utilities:

[legend]
Collaboration diagram for vtkBase64Utilities:

[legend]
List of all members.

## Detailed Description

base64 encode and decode utilities.

Date:
  2002/10/28 14:42:03

Revision:
  1.1

vtkBase64Utilities implements base64 encoding and decoding.

Created by:
  - Barre, Sebastien

CVS contributions (if > 5%):
  - Barre, Sebastien (100%)

CVS logs (CVSweb):
  - .`h` (`/IO/vtkBase64Utilities.h)`
  - .`cxx` (`/IO/vtkBase64Utilities.cxx)`

Definition at line 40 of file vtkBase64Utilities.h.

## Public Types

typedef vtkObject | Superclass

## Public Methods

virtual const char * | GetClassName ()
virtual int | IsA (const char *type)

## Static Public Methods

vtkBase64Utilities * | New ()
int | IsTypeOf (const char *type)
vtkBase64Utilities * | SafeDownCast (vtkObject *o)
void | EncodeTriplet (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
void | EncodePair (unsigned char i0, unsigned char i1, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
void | EncodeSingle (unsigned char i0, unsigned char *o0, unsigned char *o1, unsigned char *o2, unsigned char *o3)
unsigned long | Encode (const unsigned char *input, unsigned long length, unsigned char *output, int mark_end=0)
int | DecodeTriplet (unsigned char i0, unsigned char i1, unsigned char i2, unsigned char i3, unsigned char *o0, unsigned char *o1, unsigned char *o2)
unsigned long | Decode (const unsigned char *input, unsigned long length, unsigned char *output, unsigned long max_input_length=0)

## Protected Methods

| vtkBase64Utilities ()
| ~vtkBase64Utilities ()

## Member Typedef Documentation

typedef vtkObject vtkBase64Utilities::Superclass

| Reimplemented from vtkObject. Definition at line 44 of file vtkBase64Utilities.h.

## Constructor & Destructor Documentation

vtkBase64Utilities::vtkBase64Utilities | ( |  | ) | `[inline, protected]`

| Definition at line 122 of file vtkBase64Utilities.h.

vtkBase64Utilities::~vtkBase64Utilities | ( |  | ) | `[inline, protected]`

| Definition at line 123 of file vtkBase64Utilities.h.

## Member Function Documentation

vtkBase64Utilities* vtkBase64Utilities::New | ( |  | ) | `[static]`

| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. Reimplemented from vtkObject.

virtual const char* vtkBase64Utilities::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkObject.

int vtkBase64Utilities::IsTypeOf | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject.

virtual int vtkBase64Utilities::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject.

vtkBase64Utilities* vtkBase64Utilities::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkObject.

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

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

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

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).

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.

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).

The documentation for this class was generated from the following file:

- IO/vtkBase64Utilities.h