Grid 0.7.0
Grid::JSONWriter Class Reference

#include <JSON_IO.h>

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

Public Member Functions

 JSONWriter (const std::string &fileName)
virtual ~JSONWriter (void)
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::complex< U > &x)
template<typename U>
void writeDefault (const std::string &s, const std::vector< U > &x)
template<typename U, typename P>
void writeDefault (const std::string &s, const std::pair< U, P > &x)
template<std::size_t N>
void writeDefault (const std::string &s, const char(&x)[N])
void writeDefault (const std::string &s, const std::string &x)
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 delete_comma ()

Private Attributes

std::string fileName_
std::ostringstream ss_
JSONWriterupcast
bool scientific_
unsigned int prec_

Detailed Description

Definition at line 47 of file JSON_IO.h.

Constructor & Destructor Documentation

◆ JSONWriter()

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

Definition at line 34 of file JSON_IO.cc.

References fileName_, JSONWriter(), and ss_.

Referenced by JSONWriter().

◆ ~JSONWriter()

JSONWriter::~JSONWriter ( void )
virtual

Definition at line 37 of file JSON_IO.cc.

References delete_comma(), fileName_, and ss_.

Member Function Documentation

◆ push()

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

Definition at line 49 of file JSON_IO.cc.

References ss_.

◆ pop()

void JSONWriter::pop ( void )

Definition at line 58 of file JSON_IO.cc.

References delete_comma(), and ss_.

◆ writeDefault() [1/6]

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

Definition at line 141 of file JSON_IO.h.

References ss_, and U.

◆ writeDefault() [2/6]

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

Definition at line 153 of file JSON_IO.h.

References ss_.

◆ writeDefault() [3/6]

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

Definition at line 177 of file JSON_IO.h.

References delete_comma(), ss_, and Grid::Writer< JSONWriter >::write().

◆ writeDefault() [4/6]

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

Definition at line 165 of file JSON_IO.h.

References ss_.

◆ writeDefault() [5/6]

template<std::size_t N>
void Grid::JSONWriter::writeDefault ( const std::string & s,
const char(&) x[N] )

Definition at line 194 of file JSON_IO.h.

References ss_.

◆ writeDefault() [6/6]

void JSONWriter::writeDefault ( const std::string & s,
const std::string & x )

Definition at line 77 of file JSON_IO.cc.

References ss_.

◆ delete_comma()

void JSONWriter::delete_comma ( )
private

Definition at line 65 of file JSON_IO.cc.

References ss_.

Referenced by pop(), writeDefault(), and ~JSONWriter().

◆ 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::JSONWriter::writeDefault().

◆ copyScalars()

std::enable_if< EigenIO::is_scalar< S >::value, void >::type Grid::Writer< JSONWriter >::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

◆ fileName_

std::string Grid::JSONWriter::fileName_
private

Definition at line 84 of file JSON_IO.h.

Referenced by JSONWriter(), and ~JSONWriter().

◆ ss_

std::ostringstream Grid::JSONWriter::ss_
private

◆ upcast

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

Definition at line 170 of file BaseIO.h.

◆ scientific_

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

Definition at line 171 of file BaseIO.h.

◆ prec_

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

Definition at line 172 of file BaseIO.h.


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