RedCore
Loading...
Searching...
No Matches
red::StrybbleUtil Class Reference

#include <Strybble.h>

Static Public Member Functions

template<s32 TInCount, s32 TOutCount>
static s32 decodeFromChars (const u8(&encoded)[TInCount], u8(&decoded)[TOutCount])
 Decodes an array of Strybble charcodes into a proper ASCII string.
static s32 decodeFromBitstream (const u8 *bitstream, u8 *decoded, s32 charCount)
 Unpacks a packed 6-bit-per-code bitstream into an array of Strybble character codes.

Member Function Documentation

◆ decodeFromChars()

template<s32 TInCount, s32 TOutCount>
s32 red::StrybbleUtil::decodeFromChars ( const u8(&) encoded[TInCount],
u8(&) decoded[TOutCount] )
inlinestatic

Decodes an array of Strybble charcodes into a proper ASCII string.

Parameters
encodedThe input array of Strybble charcodes.
decodedThe output array to write the decoded string into.
Template Parameters
TInCountDeduced size of the input array.
TOutCountDeduced size of the output array.
Returns
The number of characters written to the output buffer, excluding the null terminator.

◆ decodeFromBitstream()

s32 red::StrybbleUtil::decodeFromBitstream ( const u8 * bitstream,
u8 * decoded,
s32 charCount )
inlinestatic

Unpacks a packed 6-bit-per-code bitstream into an array of Strybble character codes.

Parameters
bitstreamThe input array of bytes containing the bitstream to unpack.
decodedThe output buffer to write the decoded codes into.
charCountThe number of characters to decode. decoded must be sized charCount + 1.
Returns
The number of characters written to the output buffer, excluding the null terminator.