Open CASCADE Technology  7.7.0
Static Public Member Functions
FSD_Base64 Class Reference

Tool for encoding/decoding base64 stream. More...

#include <FSD_Base64.hxx>

Static Public Member Functions

static Standard_Size Encode (char *theEncodedStr, const Standard_Size theStrLen, const Standard_Byte *theData, const Standard_Size theDataLen)
 Function encoding a buffer to base64 string. More...
 
static TCollection_AsciiString Encode (const Standard_Byte *theData, const Standard_Size theDataLen)
 Function encoding a buffer to base64 string. More...
 
static Standard_Size Decode (Standard_Byte *theDecodedData, const Standard_Size theDataLen, Standard_CString theEncodedStr, const Standard_Size theStrLen)
 Function decoding base64 string. More...
 
static Handle< NCollection_BufferDecode (Standard_CString theStr, const Standard_Size theLen)
 Function decoding base64 string. More...
 

Detailed Description

Tool for encoding/decoding base64 stream.

Member Function Documentation

◆ Decode() [1/2]

static Standard_Size FSD_Base64::Decode ( Standard_Byte theDecodedData,
const Standard_Size  theDataLen,
Standard_CString  theEncodedStr,
const Standard_Size  theStrLen 
)
static

Function decoding base64 string.

Parameters
[out]theDecodedDatathe place for decoded data. If it is NULL just return the needed size.
[in]theDataLenthe length of the buffer theDecodedData in bytes. This value must not be less than value returned when theDecodedData is NULL.
[in]theEncodedStrthe input encoded string.
[in]theStrLenthe length of input encoded string.
Returns
the length of the decoded data in bytes. If theDataLen is not enough for storing all data nothing is written and 0 is returned.

◆ Decode() [2/2]

static Handle< NCollection_Buffer > FSD_Base64::Decode ( Standard_CString  theStr,
const Standard_Size  theLen 
)
static

Function decoding base64 string.

Parameters
[in]theStrthe input encoded string
[in]theLenthe length of input encoded string
Returns
null handle in case of out of memory condition

◆ Encode() [1/2]

static Standard_Size FSD_Base64::Encode ( char *  theEncodedStr,
const Standard_Size  theStrLen,
const Standard_Byte theData,
const Standard_Size  theDataLen 
)
static

Function encoding a buffer to base64 string.

Parameters
[out]theEncodedStrthe place for encoded string. Terminating null is not put. If it is NULL just return the needed size.
[in]theStrLenthe length of the buffer theEncodedStr in bytes. This value must not be less than value returned when theEncodedStr is NULL.
[in]theDatathe input binary data.
[in]theDataLenthe length of input data in bytes.
Returns
the length of the encoded string not including terminating null. If theStrLen is not enough for storing all data nothing is written and 0 is returned.

◆ Encode() [2/2]

static TCollection_AsciiString FSD_Base64::Encode ( const Standard_Byte theData,
const Standard_Size  theDataLen 
)
static

Function encoding a buffer to base64 string.

Parameters
[in]theDatathe input binary data
[in]theDataLenthe length of input data in bytes
Returns
Base64 encoded string.

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