CEPS  24.01
Cardiac ElectroPhysiology Simulator
FileWriter Class Reference

Detailed Description

Enables the writing of files.

Definition at line 39 of file FileWriter.hpp.

#include <FileWriter.hpp>

Inheritance diagram for FileWriter:
[legend]

Public Member Functions

 FileWriter (CepsBool binary=false)
 Constructor. More...
 
 FileWriter (const CepsString &file, CepsBool binary=false)
 Constructor. More...
 
 ~FileWriter () override
 Constructor. More...
 
CepsString getFileName ()
 Name of parsed file. More...
 
void open ()
 Creates file or cleans previous content. More...
 
void close ()
 Close current file. More...
 
CepsBool good ()
 Tells if file is ok. More...
 
void reset ()
 The file stream is placed at the beginning of the file. More...
 
void write (const CepsString &s)
 Single line writing. More...
 
template<typename T >
FileWriteroperator<< (const T &content)
 Writing operator. More...
 
- Public Member Functions inherited from CepsObject
 CepsObject ()=default
 default constructor More...
 
 CepsObject (const CepsObject &)=default
 Copy constructor. More...
 
virtual ~CepsObject ()=default
 Destructor. More...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () const
 Access to profiler. More...
 

Protected Attributes

CepsString m_fileName
 file to write More...
 
std::ofstream m_file
 corresponding stream More...
 
CepsBool m_binary
 binary output if true More...
 

Additional Inherited Members

- Static Protected Attributes inherited from CepsObject
static Profiler m_profiler
 The same profiler for each big object. More...
 

Constructor & Destructor Documentation

◆ FileWriter() [1/2]

FileWriter::FileWriter ( CepsBool  binary = false)
explicit

Constructor.

Parameters
binarywrite in binary or not. Default to false

Definition at line 35 of file FileWriter.cpp.

◆ FileWriter() [2/2]

FileWriter::FileWriter ( const CepsString file,
CepsBool  binary = false 
)
explicit

Constructor.

Parameters
filethe name of the file to write.
binarywrite in binary or not. Default to false

Definition at line 40 of file FileWriter.cpp.

◆ ~FileWriter()

FileWriter::~FileWriter ( )
override

Constructor.

Parameters
binarybinary format or not

Destructor.

Definition at line 47 of file FileWriter.cpp.

Member Function Documentation

◆ close()

void FileWriter::close ( )

Close current file.

Definition at line 77 of file FileWriter.cpp.

◆ getFileName()

CepsString FileWriter::getFileName ( )

Name of parsed file.

Definition at line 53 of file FileWriter.cpp.

◆ good()

CepsBool FileWriter::good ( )

Tells if file is ok.

Definition at line 84 of file FileWriter.cpp.

◆ open()

void FileWriter::open ( )

Creates file or cleans previous content.

Definition at line 59 of file FileWriter.cpp.

◆ operator<<()

template<typename T >
FileWriter& FileWriter::operator<< ( const T &  content)
inline

Writing operator.

Definition at line 89 of file FileWriter.hpp.

◆ reset()

void FileWriter::reset ( )

The file stream is placed at the beginning of the file.

Definition at line 90 of file FileWriter.cpp.

◆ write()

void FileWriter::write ( const CepsString s)

Single line writing.

Definition at line 96 of file FileWriter.cpp.

Field Documentation

◆ m_binary

CepsBool FileWriter::m_binary
protected

binary output if true

Definition at line 100 of file FileWriter.hpp.

◆ m_file

std::ofstream FileWriter::m_file
protected

corresponding stream

Definition at line 99 of file FileWriter.hpp.

◆ m_fileName

CepsString FileWriter::m_fileName
protected

file to write

Definition at line 98 of file FileWriter.hpp.


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