Public Member Functions | Public Attributes | List of all members
nmx::Format Class Reference

The Format class Formatierte Ausgabe von Arrays. More...

#include <xfmt.h>

Public Member Functions

 Format (const std::string &sep, const std::string &lend, std::streamsize prec=3)
 Format Konstruktor. More...
 
 Format (const std::string &name, const std::string &sep, const std::string &lend, const std::string &ext, std::streamsize prec=3)
 Format Konstruktor. More...
 
auto operator() () const
 operator () Ausgabe von Trennzeichen,Zeichen am Ende jeder Zeile More...
 
template<class T >
void write_line (std::ostream &ofs, const T &crow) const
 write_line Daten in einem Array werden in einer Zeile ausgegeben More...
 
template<class X , class... Y>
void as_rows (std::ostream &ofs, const X &x, const Y &... y) const
 as_rows beliebige Anzahl von Arrays werden als Reihen ausgegeben More...
 
template<class X , class... Y>
void as_columns (std::ostream &ofs, const X &x, const Y &... y) const
 as_columns beliebige Anzahl von Arrays werden als Spalten einer Tabelle dargestellt More...
 
template<class T >
void as_columns (std::ostream &ofs, const T &data) const
 as_columns Array von Arrays wird als Tabelle ausgegeben. More...
 
void set_defaults (std::ostream &ofs) const
 set_defaults Formatierung der Zahlen More...
 
const std::string & sep () const
 
const std::string & lend () const
 
const std::string & name () const
 
const std::string & ext () const
 

Public Attributes

std::streamsize precision = 3
 

Detailed Description

The Format class Formatierte Ausgabe von Arrays.

Definition at line 10 of file xfmt.h.

Constructor & Destructor Documentation

◆ Format() [1/2]

nmx::Format::Format ( const std::string &  sep,
const std::string &  lend,
std::streamsize  prec = 3 
)
inline

Format Konstruktor.

Parameters
sepTrennzeichen
lendZeichen am Ende einer Reihe
precAnzahl der Nachkommastellen

Definition at line 25 of file xfmt.h.

◆ Format() [2/2]

nmx::Format::Format ( const std::string &  name,
const std::string &  sep,
const std::string &  lend,
const std::string &  ext,
std::streamsize  prec = 3 
)
inline

Format Konstruktor.

Parameters
nameDateiname
sepTrennzeichen
lendZeichen am Ende einer Reihe
extDateisuffix
precAnzahl der Nachkommastellen

Definition at line 42 of file xfmt.h.

Member Function Documentation

◆ as_columns() [1/2]

template<class X , class... Y>
void nmx::Format::as_columns ( std::ostream &  ofs,
const X &  x,
const Y &...  y 
) const
inline

as_columns beliebige Anzahl von Arrays werden als Spalten einer Tabelle dargestellt

Parameters
ofsAusgabestrom
xArray

Definition at line 100 of file xfmt.h.

◆ as_columns() [2/2]

template<class T >
void nmx::Format::as_columns ( std::ostream &  ofs,
const T &  data 
) const
inline

as_columns Array von Arrays wird als Tabelle ausgegeben.

Parameters
ofsAusgabestrom
dataArray von Arrays

Definition at line 118 of file xfmt.h.

◆ as_rows()

template<class X , class... Y>
void nmx::Format::as_rows ( std::ostream &  ofs,
const X &  x,
const Y &...  y 
) const
inline

as_rows beliebige Anzahl von Arrays werden als Reihen ausgegeben

Parameters
ofsAusgabestrom
xArray

Definition at line 81 of file xfmt.h.

◆ ext()

const std::string& nmx::Format::ext ( ) const
inline

Definition at line 142 of file xfmt.h.

◆ lend()

const std::string& nmx::Format::lend ( ) const
inline

Definition at line 140 of file xfmt.h.

◆ name()

const std::string& nmx::Format::name ( ) const
inline

Definition at line 141 of file xfmt.h.

◆ operator()()

auto nmx::Format::operator() ( ) const
inline

operator () Ausgabe von Trennzeichen,Zeichen am Ende jeder Zeile

Definition at line 57 of file xfmt.h.

◆ sep()

const std::string& nmx::Format::sep ( ) const
inline

Definition at line 139 of file xfmt.h.

◆ set_defaults()

void nmx::Format::set_defaults ( std::ostream &  ofs) const
inline

set_defaults Formatierung der Zahlen

Parameters
ofsAusgabestrom

Definition at line 133 of file xfmt.h.

◆ write_line()

template<class T >
void nmx::Format::write_line ( std::ostream &  ofs,
const T &  crow 
) const
inline

write_line Daten in einem Array werden in einer Zeile ausgegeben

Parameters
ofsAusgabestrom
crowArray

Definition at line 66 of file xfmt.h.

Member Data Documentation

◆ precision

std::streamsize nmx::Format::precision = 3

Definition at line 17 of file xfmt.h.


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