OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::Base64Decoder< T > Class Template Reference

#include <base64.h>

+ Collaboration diagram for olb::Base64Decoder< T >:

Public Member Functions

 Base64Decoder (std::istream &istr_, size_t fullLength_)
 
void decode (T *data, size_t length)
 

Detailed Description

template<typename T>
class olb::Base64Decoder< T >

Definition at line 62 of file base64.h.

Constructor & Destructor Documentation

◆ Base64Decoder()

template<typename T >
olb::Base64Decoder< T >::Base64Decoder ( std::istream & istr_,
size_t fullLength_ )

Definition at line 137 of file base64.hh.

138 : istr(istr_),
139 charFullLength(fullLength_ * sizeof(T)),
140 numRead(0),
141 posOverflow(3)
142{ }

Member Function Documentation

◆ decode()

template<typename T >
void olb::Base64Decoder< T >::decode ( T * data,
size_t length )

Definition at line 145 of file base64.hh.

146{
147 unsigned char* charData = reinterpret_cast<unsigned char*>(data);
148 size_t charLength = length * sizeof(T);
149 OLB_PRECONDITION( numRead+charLength <= charFullLength );
150
151 size_t pos = 0;
152 flushOverflow(charData, charLength, pos);
153 while (pos+3 <= charLength) {
154 decodeBlock(charData+pos);
155 pos += 3;
156 }
157 if (pos < charLength) {
158 decodeBlock(overflow);
159 posOverflow=0;
160 flushOverflow(charData, charLength, pos);
161 }
162 numRead += charLength;
163}
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References OLB_PRECONDITION.

+ Here is the caller graph for this function:

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