The Base64 encoder class. More...

#include "murl_util_encoding_base64.h"

Inheritance diagram for Murl::Util::Base64Encoder:

Public Member Functions

 Base64Encoder ()
 The default constructor. More...
 
 Base64Encoder (UInt32 charsPerLine)
 Constructor enabling line formatting. More...
 
UInt64 GetEncodedLength (UInt64 byteSizeIn) const
 Compute the Base64 encoded length. More...
 
UInt64 Encode (const void *dataIn, UInt64 byteSizeIn, void *dataOut, UInt64 byteSizeOut, Bool encodeEnd=true)
 Encode a memory block to Base64 characters. More...
 
UInt64 EncodeEnd (void *dataOut, UInt64 byteSizeOut)
 Encode the Base64 end padding characters. More...
 
Char EncodeValue (Char value) const
 Encode a 6-bit value to the Base64 character. More...
 

Protected Attributes

UInt32 mLineCount
 The current line character position. More...
 
UInt32 mCharsPerLine
 The maximum characters per line. More...
 
- Protected Attributes inherited from Murl::Util::Base64State
Step mStep
 The current state. More...
 
Char mChar
 The current character. More...
 

Additional Inherited Members

- Protected Types inherited from Murl::Util::Base64State
enum  Step { STEP_A, STEP_B, STEP_C, STEP_D }
 State enumeration. More...
 
- Protected Member Functions inherited from Murl::Util::Base64State
 Base64State ()
 The default constructor.
 

Detailed Description

The Base64 encoder class.

Constructor & Destructor Documentation

◆ Base64Encoder() [1/2]

Murl::Util::Base64Encoder::Base64Encoder ( )

The default constructor.

Line formatting is disabled.

◆ Base64Encoder() [2/2]

Murl::Util::Base64Encoder::Base64Encoder ( UInt32  charsPerLine)

Constructor enabling line formatting.

Parameters
charsPerLineThe maximum characters per line.

Member Function Documentation

◆ GetEncodedLength()

UInt64 Murl::Util::Base64Encoder::GetEncodedLength ( UInt64  byteSizeIn) const

Compute the Base64 encoded length.

Parameters
byteSizeInThe number of source bytes.
Returns
The number of bytes required for Base64 encoding.

◆ Encode()

UInt64 Murl::Util::Base64Encoder::Encode ( const void *  dataIn,
UInt64  byteSizeIn,
void *  dataOut,
UInt64  byteSizeOut,
Bool  encodeEnd = true 
)

Encode a memory block to Base64 characters.

Encoding can be called sequential for divided source blocks.

Parameters
dataInPointer to the source memory block.
byteSizeInThe byte size of the source memory block.
dataOutPointer to the destination memory block.
byteSizeOutThe byte size of the destination memory block.
encodeEndIf true the padding characters are encoded automatically at the end of the block. Set to false if sequential encoding is required and call EncodeEnd method finally.
Returns
The number of bytes written into destination.

◆ EncodeEnd()

UInt64 Murl::Util::Base64Encoder::EncodeEnd ( void *  dataOut,
UInt64  byteSizeOut 
)

Encode the Base64 end padding characters.

This method is required if the encodeEnd parameter from the Encode method is set to false.

Parameters
dataOutPointer to the destination memory block.
byteSizeOutThe byte size of the destination memory block.
Returns
The number of bytes written into destination.

◆ EncodeValue()

Char Murl::Util::Base64Encoder::EncodeValue ( Char  value) const

Encode a 6-bit value to the Base64 character.

Parameters
valueThe 6-bit value to encode.
Returns
The corresponding Base64 character or '=' if the value is out of range.

Member Data Documentation

◆ mLineCount

UInt32 Murl::Util::Base64Encoder::mLineCount
protected

The current line character position.

◆ mCharsPerLine

UInt32 Murl::Util::Base64Encoder::mCharsPerLine
protected

The maximum characters per line.


The documentation for this class was generated from the following file:
  • murl_util_encoding_base64.h


Copyright © 2011-2018 Spraylight GmbH.