Grid 0.7.0
Grid::TextWriter Class Reference

#include <TextIO.h>

Inheritance diagram for Grid::TextWriter:
Grid::Writer< TextWriter >

Public Member Functions

 TextWriter (const std::string &fileName)
virtual ~TextWriter (void)=default
void push (const std::string &s)
void pop (void)
template<typename U>
void writeDefault (const std::string &s, const U &x)
template<typename U>
void writeDefault (const std::string &s, const std::vector< U > &x)
template<typename U>
void writeMultiDim (const std::string &s, const std::vector< size_t > &Dimensions, const U *pDataRowMajor, size_t NumElements)
std::enable_if< std::is_base_of< Serializable, U >::value >::type write (const std::string &s, const U &output)
std::enable_if< EigenIO::is_scalar< S >::value, void >::type copyScalars (S *&pCopy, const S &Source)
void scientificFormat (const bool set)
bool isScientific (void)
void setPrecision (const unsigned int prec)
unsigned int getPrecision (void)

Private Member Functions

void indent (void)

Private Attributes

std::ofstream file_
int level_
TextWriterupcast
bool scientific_
unsigned int prec_

Detailed Description

Definition at line 43 of file TextIO.h.

Constructor & Destructor Documentation

◆ TextWriter()

TextWriter::TextWriter ( const std::string & fileName)

Definition at line 36 of file TextIO.cc.

References file_, and TextWriter().

Referenced by TextWriter().

◆ ~TextWriter()

virtual Grid::TextWriter::~TextWriter ( void )
virtualdefault

References U.

Member Function Documentation

◆ push()

void TextWriter::push ( const std::string & s)

Definition at line 40 of file TextIO.cc.

References level_.

◆ pop()

void TextWriter::pop ( void )

Definition at line 45 of file TextIO.cc.

References level_.

◆ writeDefault() [1/2]

template<typename U>
void Grid::TextWriter::writeDefault ( const std::string & s,
const U & x )

Definition at line 85 of file TextIO.h.

References file_, indent(), and U.

◆ writeDefault() [2/2]

template<typename U>
void Grid::TextWriter::writeDefault ( const std::string & s,
const std::vector< U > & x )

Definition at line 92 of file TextIO.h.

References Grid::Writer< TextWriter >::write().

◆ writeMultiDim()

template<typename U>
void Grid::TextWriter::writeMultiDim ( const std::string & s,
const std::vector< size_t > & Dimensions,
const U * pDataRowMajor,
size_t NumElements )

Definition at line 104 of file TextIO.h.

References U, and Grid::Writer< TextWriter >::write().

◆ indent()

void TextWriter::indent ( void )
private

Definition at line 50 of file TextIO.cc.

References file_, GRID_TEXT_INDENT, and level_.

Referenced by writeDefault().

◆ write()

std::enable_if<!std::is_base_of< Serializable, U >::value &&!EigenIO::is_tensor< U >::value, void >::type Writer::write ( const std::string & s,
const U & output )
inherited

Definition at line 136 of file BaseIO.h.

Referenced by Grid::TextWriter::writeDefault(), and Grid::TextWriter::writeMultiDim().

◆ copyScalars()

std::enable_if< EigenIO::is_scalar< S >::value, void >::type Grid::Writer< TextWriter >::copyScalars ( S *& pCopy,
const S & Source )
inlineinherited

Definition at line 152 of file BaseIO.h.

◆ scientificFormat()

void Writer::scientificFormat ( const bool set)
inherited

Definition at line 165 of file BaseIO.h.

◆ isScientific()

bool Writer::isScientific ( void )
inherited

Definition at line 166 of file BaseIO.h.

◆ setPrecision()

void Writer::setPrecision ( const unsigned int prec)
inherited

Definition at line 167 of file BaseIO.h.

◆ getPrecision()

unsigned int Writer::getPrecision ( void )
inherited

Definition at line 168 of file BaseIO.h.

Field Documentation

◆ file_

std::ofstream Grid::TextWriter::file_
private

Definition at line 59 of file TextIO.h.

Referenced by indent(), TextWriter(), and writeDefault().

◆ level_

int Grid::TextWriter::level_
private

Definition at line 60 of file TextIO.h.

Referenced by indent(), pop(), and push().

◆ upcast

TextWriter* Grid::Writer< TextWriter >::upcast
privateinherited

Definition at line 170 of file BaseIO.h.

◆ scientific_

bool Grid::Writer< TextWriter >::scientific_
privateinherited

Definition at line 171 of file BaseIO.h.

◆ prec_

unsigned int Grid::Writer< TextWriter >::prec_
privateinherited

Definition at line 172 of file BaseIO.h.


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