walberla::vtk::Base64Writer Class Reference

Detailed Description

Class for encoding VTK compatible base64 data streams.

This class is typically used as follows: First, an instance of type Base64Writer is created. It is then filled with data using the left shift operator. Finally, the base64 encoded data is written to a VTK file by calling the member function toStream( std::ostream& os ) where "os" is a reference to an output stream which is attached to the VTK output file:

std::ofstream vtkFile( [filename] );
[...]
Base64Writer base64;
for( ... )
base64 << [data];
base64.toStream( vtkFile ); // In accordance with the VTK specification, the beginning of the base64 encoded
// stream will contain a 32bit unsigned int value specifying the size (in bytes) of
// the data that follows.
[...]
vtkFile.close();

#include <Base64Writer.h>

Public Member Functions

template<typename T >
Base64Writeroperator<< (const T &data)
 This function can be used in order to add data to a Base64Writer instance which then can be converted to a base64 encoded stream. More...
 
void toStream (std::ostream &os)
 This function can be used in order to convert all the data that was passed to this Base64Writer object into a base64 encoded stream. More...
 

Private Member Functions

void encodeblock (unsigned char in[3], unsigned char out[4], int len)
 

Private Attributes

std::vector< char > buffer_
 

Member Function Documentation

◆ encodeblock()

void walberla::vtk::Base64Writer::encodeblock ( unsigned char  in[3],
unsigned char  out[4],
int  len 
)
inlineprivate

◆ operator<<()

template<typename T >
Base64Writer& walberla::vtk::Base64Writer::operator<< ( const T &  data)
inline

This function can be used in order to add data to a Base64Writer instance which then can be converted to a base64 encoded stream.

For more information on how a Base64Writer is typically used refer to the documentation/general description of this class.

◆ toStream()

void walberla::vtk::Base64Writer::toStream ( std::ostream &  os)

This function can be used in order to convert all the data that was passed to this Base64Writer object into a base64 encoded stream.

In accordance with the VTK specification, the beginning of the base64 encoded stream will contain a 32bit unsigned int value specifying the size (in bytes) of the data that follows. For more information on how a Base64Writer is typically used refer to the documentation/general description of this class.

Member Data Documentation

◆ buffer_

std::vector<char> walberla::vtk::Base64Writer::buffer_
private

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