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

#include <base64.h>

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

Public Member Functions

 Base64Encoder (std::ostream &ostr_, size_t fullLength_)
 
void encode (const T *data, size_t length)
 

Detailed Description

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

Definition at line 41 of file base64.h.

Constructor & Destructor Documentation

◆ Base64Encoder()

template<typename T >
olb::Base64Encoder< T >::Base64Encoder ( std::ostream & ostr_,
size_t fullLength_ )

Definition at line 51 of file base64.hh.

52 : ostr(ostr_),
53 charFullLength(fullLength_ * sizeof(T)),
54 numWritten(0),
55 numOverflow(0)
56{ }

Member Function Documentation

◆ encode()

template<typename T >
void olb::Base64Encoder< T >::encode ( const T * data,
size_t length )

Definition at line 59 of file base64.hh.

60{
61 const unsigned char* charData = reinterpret_cast<const unsigned char*>(data);
62 size_t charLength = length * sizeof(T);
63 OLB_PRECONDITION( numWritten+charLength <= charFullLength );
64
65 size_t pos=0;
66 fillOverflow(charData, charLength, pos);
67 while (pos+3 <= charLength) {
68 encodeBlock(charData+pos);
69 pos += 3;
70 }
71 fillOverflow(charData, charLength, pos);
72 numWritten += charLength;
73 if (numWritten == charFullLength) {
74 flushOverflow();
75 }
76}
#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: