Rhino C++ API  7.21
Public Member Functions | Public Attributes | List of all members
ON_DecodeBase64 Class Reference

#include <opennurbs_base64.h>

Public Member Functions

 ON_DecodeBase64 ()
 
virtual ~ON_DecodeBase64 ()
 
void Begin ()
 
const char * Decode (const char *base64str)
 
const char * Decode (const char *base64str, size_t base64str_count)
 
const wchar_t * Decode (const wchar_t *base64str)
 
const wchar_t * Decode (const wchar_t *base64str, size_t base64str_count)
 
bool End ()
 
const bool Error () const
 
virtual void Output ()
 
void SetError ()
 

Public Attributes

unsigned int m_decode_count
 
unsigned char m_output [512]
 
int m_output_count
 0 to 512 More...
 

Constructor & Destructor Documentation

◆ ON_DecodeBase64()

ON_DecodeBase64::ON_DecodeBase64 ( )

◆ ~ON_DecodeBase64()

virtual ON_DecodeBase64::~ON_DecodeBase64 ( )
virtual

Member Function Documentation

◆ Begin()

void ON_DecodeBase64::Begin ( )

◆ Decode() [1/4]

const char* ON_DecodeBase64::Decode ( const char *  base64str)

Decode will generate zero or more callbacks to the virtual Output() function. If the base 64 encoded information is in pieces, you can call Decode() for each piece. For example, if your encoded information is in a text file, you might call Decode() for every line in the file. Decode() returns 0 if there is nothing in base64str to decode or if it detects an error that prevents any further decoding. The function Error() can be used to determine if an error occured. Otherwise, Decode() returns a pointer to the location in the string where it stopped decoding because it detected a character, like a null terminator, an end of line character, or any other character that could not be part of the base 64 encoded information.

◆ Decode() [2/4]

const char* ON_DecodeBase64::Decode ( const char *  base64str,
size_t  base64str_count 
)

◆ Decode() [3/4]

const wchar_t* ON_DecodeBase64::Decode ( const wchar_t *  base64str)

◆ Decode() [4/4]

const wchar_t* ON_DecodeBase64::Decode ( const wchar_t *  base64str,
size_t  base64str_count 
)

◆ End()

bool ON_DecodeBase64::End ( )

You must call End() when Decode() returns 0 or when you have reached the end of your encoded information. End() may callback to Output() zero or one time. If all the information passed to Decode() was successfully decoded, then End() returns true. If something was not decoded, then End() returns false.

◆ Error()

const bool ON_DecodeBase64::Error ( ) const

Returns true if an error occured during decoding because invalid input was passed to Decode().

◆ Output()

virtual void ON_DecodeBase64::Output ( )
virtual

Override the virtual Output() callback function to process the decoded output. Each time Output() is called there are m_output_count bytes in the m_output[] array. Every call to Decode() can result in zero, one, or many callbacks to Output(). Calling End() may result in zero or one callbacks to Output().

◆ SetError()

void ON_DecodeBase64::SetError ( )

Call if your Output() function detects an error and wants to stop further decoding.

Member Data Documentation

◆ m_decode_count

unsigned int ON_DecodeBase64::m_decode_count

m_decode_count = total number of input base64 characters that Decode() has decoded.

◆ m_output

unsigned char ON_DecodeBase64::m_output[512]

◆ m_output_count

int ON_DecodeBase64::m_output_count

0 to 512