GCBM
Public Member Functions | Private Attributes | List of all members
CBMFlatFile Class Reference

#include <cbmaggregatorcsvwriter.h>

Collaboration diagram for CBMFlatFile:
Collaboration graph

Public Member Functions

 CBMFlatFile (const std::string &path, const std::string &header)
 
virtual ~CBMFlatFile ()=default
 
void write (const std::string &text)
 
void save ()
 

Private Attributes

std::string _path
 
std::string _tempPath
 
std::unique_ptr< Poco::File > _outputFile
 
std::unique_ptr< Poco::FileOutputStream > _streamFile
 
std::unique_ptr< Poco::TeeOutputStream > _outputStream
 

Constructor & Destructor Documentation

◆ CBMFlatFile()

CBMFlatFile ( const std::string &  path,
const std::string &  header 
)

Constructor

Initialise CBMFlatFile._tempPath to a temporary file path, as parameter path + "_" + random number generated using rand(),
CBMFlatFile._outputFile as a unique pointer to CBMFlatFile._tempPath of type Poco::File,
CBMFlatFile._streamFile as a unique pointer to CBMFlatFile._tempPath of type Poco::FileOutputStream
CBMFlatFile. _outputStream as a unique pointer to CBMFlatFile._streamFile of type Poco::TeeOutputStream

The parameter is written in the _outputStream.

Parameters
pathstring&
headerstring&
Returns
void

◆ ~CBMFlatFile()

virtual ~CBMFlatFile ( )
virtualdefault

Member Function Documentation

◆ save()

void save ( )

Save an existing file

Returns
void

◆ write()

void write ( const std::string &  text)

Write parameter text to *_outputStream

Parameters
textstring&
Returns
void

Member Data Documentation

◆ _outputFile

std::unique_ptr<Poco::File> _outputFile
private

◆ _outputStream

std::unique_ptr<Poco::TeeOutputStream> _outputStream
private

◆ _path

std::string _path
private

◆ _streamFile

std::unique_ptr<Poco::FileOutputStream> _streamFile
private

◆ _tempPath

std::string _tempPath
private

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