Rhino C++ API
8.14
|
#include <opennurbs_base64.h>
Public Member Functions | |
ON_Base64EncodeStream () | |
virtual | ~ON_Base64EncodeStream () |
bool | Begin () |
void * | CallbackContext () const |
ON_StreamCallbackFunction | CallbackFunction () const |
bool | End () |
bool | In (ON__UINT64 in_buffer_size, const void *in_buffer) |
ON__UINT32 | InCRC () const |
ON__UINT64 | InSize () const |
virtual bool | Out (void *callback_context, ON__UINT32 out_buffer_size, const char *out_buffer) |
ON__UINT32 | OutCRC () const |
ON__UINT64 | OutSize () const |
bool | SetCallback (ON_StreamCallbackFunction callback_function, void *callback_context) |
Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
For complete openNURBS copyright information see http://www.opennurbs.org.
ON_Base64EncodeStream::ON_Base64EncodeStream | ( | ) |
|
virtual |
bool ON_Base64EncodeStream::Begin | ( | ) |
void* ON_Base64EncodeStream::CallbackContext | ( | ) | const |
Returns: Current value of the context pointer passed as the first argument to the base64 encoded stream output handler function.
ON_StreamCallbackFunction ON_Base64EncodeStream::CallbackFunction | ( | ) | const |
Returns: Current value of the callback function for handling the base64 encoded stream. If the callback function is null, the the virtual Out() function is used to handle the output stream.
bool ON_Base64EncodeStream::End | ( | ) |
bool ON_Base64EncodeStream::In | ( | ON__UINT64 | in_buffer_size, |
const void * | in_buffer | ||
) |
Description: Call In() one or more times to base64 encode a stream of bytes. After the last call to In(), call End(). Calling In() will result in at least in_buffer_size/57 and at most (in_buffer_size+56)/57 calls to to the output stream handler. Parameters: in_buffer_size - [in] number of bytes in in_buffer in_buffer - [in] Returns: true if successful, false if an error occurred.
ON__UINT32 ON_Base64EncodeStream::InCRC | ( | ) | const |
Returns: Then the returned value is the 32-bit crc of the input stream. The crc is updated every time In() is called before any calls are made to the output stream handler. If the base64 encoding calculation is finished ( End() has been called ), then the returned value is the 32-bit crc of the entire input stream.
ON__UINT64 ON_Base64EncodeStream::InSize | ( | ) | const |
Returns: Then the returned value is the total number bytes in the input stream. The size is updated every time In() is called before any calls are made to the output stream handler. If the calculation is finished ( End() has been called ), then the returned value is the total number of bytes in the entire input stream.
|
virtual |
Description: If an explicit base 64 encoded stream output handler is not specified ( CallbackFunction() returns null ), then the virtual Out() function is called to handle the base 64 encoded output stream. As the input stream is encoded, one or more calls to Out() will occur.
With a possible exception of the last call to Out(), when Out() is called, 57 input bytes have been encoded into 76 output characters with ASCII codes A-Z, a-z, 0-9, +, /. Parameters: callback_context - [in] context pointer set by calling SetCallback(). Typically the context pointer is not used by a virtual override because the context can be added as member variables of the derived class, but it is available if needed. out_buffer_size - [in] number of non-null characters in out_buffer. out_buffer - [in] A null terminated ASCII string that is a base 64 encoding. out_buffer[0...(out_buffer_size-1)] are ASCII characters with values characters with ASCII codes A-Z, a-z, 0-9, +, / and out_buffer[out_buffer_size] = 0.
Returns: True to continue base 64 encodeing and false to cancel the encoding calculation.
ON__UINT32 ON_Base64EncodeStream::OutCRC | ( | ) | const |
Returns: Then the returned value is the 32bit crc of the output stream. The crc is updated immediately after each call to the output stream handler. If the calculation is finished ( End() has been called ), then the returned value is the 32-bit crc of the entire output stream.
ON__UINT64 ON_Base64EncodeStream::OutSize | ( | ) | const |
Returns: Then the returned value is the total number characters in the output stream. The size is incremented immediately after each call to the output stream handler. If the base64 encoding calculation is finished ( End() has been called ), then the returned value is the total number of bytes in the entire output stream.
bool ON_Base64EncodeStream::SetCallback | ( | ON_StreamCallbackFunction | callback_function, |
void * | callback_context | ||
) |
Description: ON_Base64EncodeStream delivers the base64 encoded stream by calling a base64 encoded stream output handler function. There are two options for specifying the base64 encoded stream output handler function.