ScummVM API documentation
Base64 encoding & decoding.

Description

API for encoding and decoding Base64 strings.

Functions

bool Common::b64Validate (String &string)
 
String Common::b64EncodeString (String &string)
 
String Common::b64EncodeStream (ReadStream &stream)
 
String Common::b64EncodeData (void *dataPtr, size_t dataSize)
 
String Common::b64DecodeString (String &string)
 
MemoryReadStreamCommon::b64DecodeStream (String &string, uint32 outputLength)
 
bool Common::b64DecodeData (String &string, void *dataPtr)
 

Function Documentation

◆ b64Validate()

bool Common::b64Validate ( String string)

Validates a string to see if its a properly Base64 encoded string. This gets called when using the decode functions.

Parameters
[in]stringthe string to validate
Returns
true on success, false if an error occurred.

◆ b64EncodeString()

String Common::b64EncodeString ( String string)

Encodes a string into a Base64 encoded string.

Parameters
[in]stringthe string to encode
Returns
String containing the Base64 encoded string.

◆ b64EncodeStream()

String Common::b64EncodeStream ( ReadStream stream)

Encodes a ReadStream into a Base64 encoded string.

Parameters
[in]streamthe stream to encode
Returns
String containing the Base64 encoded string.

◆ b64EncodeData()

String Common::b64EncodeData ( void *  dataPtr,
size_t  dataSize 
)

Encodes a data pointer into a Base64 encoded string.

Parameters
[in]dataPtrpointer to data to encode
Returns
String containing the Base64 encoded string.

◆ b64DecodeString()

String Common::b64DecodeString ( String string)

Decodes a Base64 encoded string into a regular string.

Parameters
[in]stringbase64 encoded string to decode
Returns
String containing the decoded result, empty string if an error occurred.

◆ b64DecodeStream()

MemoryReadStream* Common::b64DecodeStream ( String string,
uint32  outputLength 
)

Decodes a Base64 encoded string into a MemoryReadStream, its contents will be disposed when deleting the stream.

Parameters
[in]stringbase64 encoded string to decode
Returns
MemoryReadStream pointer containing the decoded result, nullptr if an error occurred

◆ b64DecodeData()

bool Common::b64DecodeData ( String string,
void *  dataPtr 
)

Decodes a Base64 encoded string into the set data pointer

Parameters
[in]stringbase64 encoded string to decode
Returns
true on success, false if an error occurred