Evo C++ Library v0.5.1
Public Types | Public Member Functions | Public Attributes | List of all members
FmtTableOut< T, W > Struct Template Reference

#include <evo/fmt.h>

Detailed Description

template<class T, class W = FmtTable::CachedWriter>
struct evo::FmtTableOut< T, W >

Output interface for writing text table to stream/string.

Template Parameters
TString, Stream, or StreamOut object to write to
WWriter to use, one of: FmtTable::CachedWriter, or FmtTable::Writer

Public Types

typedef FmtTableOut< T, W > This
 This type. More...
 

Public Member Functions

 FmtTableOut (T &out, FmtTable &table, FmtTable::Type type=FmtTable::tTEXT)
 Constructor. More...
 
 ~FmtTableOut ()
 Destructor to finish writing table. More...
 
Thisoperator<< (char val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (const FmtChar &val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (const char *val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (const StringBase &val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (const FmtString &val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (short val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (int val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (long val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (longl val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (ushort val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (uint val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (ulong val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (ulongl val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (float val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (double val)
 Write value for current column in current row and move to next column. More...
 
Thisoperator<< (ldouble val)
 Write value for current column in current row and move to next column. More...
 
template<class V >
Thisoperator<< (const FmtIntT< V > &val)
 Write FmtIntT value for current column in current row and move to next column. More...
 
template<class V >
Thisoperator<< (const FmtFloatT< V > &val)
 Write FmtFloatT value for current column in current row and move to next column. More...
 
template<class V >
Thisoperator<< (const IntegerT< V > &val)
 Write IntegerT value for current column in current row and move to next column. More...
 
template<class V >
Thisoperator<< (const FloatT< V > &val)
 Write FloatT value for current column in current row and move to next column. More...
 
Thisoperator<< (Newline)
 End current row. More...
 
Thisoperator<< (Flush)
 Flush any cached output. More...
 

Public Attributes

T & out
 Paired output string/stream to write to. More...
 
writer
 Writer to use with FmtTable. More...
 

Member Typedef Documentation

◆ This

typedef FmtTableOut<T,W> This

This type.

Constructor & Destructor Documentation

◆ FmtTableOut()

FmtTableOut ( T &  out,
FmtTable table,
FmtTable::Type  type = FmtTable::tTEXT 
)
inline

Constructor.

Parameters
outOutput string/stream to write to
tableFmtTable instance to use for column information
typeOutput type to use – see FmtTable::Type

◆ ~FmtTableOut()

~FmtTableOut ( )
inline

Destructor to finish writing table.

  • Caution: In some cases a stream can throw an exception (if enabled) during the flush so it's better to do flush explicitly with operator<<(Flush)

Member Function Documentation

◆ operator<<() [1/22]

This& operator<< ( char  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [2/22]

This& operator<< ( const FmtChar val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [3/22]

This& operator<< ( const char *  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [4/22]

This& operator<< ( const StringBase val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [5/22]

This& operator<< ( const FmtString val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [6/22]

This& operator<< ( short  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [7/22]

This& operator<< ( int  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [8/22]

This& operator<< ( long  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [9/22]

This& operator<< ( longl  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [10/22]

This& operator<< ( ushort  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [11/22]

This& operator<< ( uint  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [12/22]

This& operator<< ( ulong  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [13/22]

This& operator<< ( ulongl  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [14/22]

This& operator<< ( float  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [15/22]

This& operator<< ( double  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [16/22]

This& operator<< ( ldouble  val)
inline

Write value for current column in current row and move to next column.

Parameters
valValue to write
Returns
This

◆ operator<<() [17/22]

This& operator<< ( const FmtIntT< V > &  val)
inline

Write FmtIntT value for current column in current row and move to next column.

Template Parameters
VType used with FmtIntT, inferred from argument
Parameters
valValue to write
Returns
This

◆ operator<<() [18/22]

This& operator<< ( const FmtFloatT< V > &  val)
inline

Write FmtFloatT value for current column in current row and move to next column.

Template Parameters
VType used with FmtFloatT, inferred from argument
Parameters
valValue to write
Returns
This

◆ operator<<() [19/22]

This& operator<< ( const IntegerT< V > &  val)
inline

Write IntegerT value for current column in current row and move to next column.

  • The output will be empty/blank if val is null
Template Parameters
VType used with IntegerT, inferred from argument
Parameters
valValue to write
Returns
This

◆ operator<<() [20/22]

This& operator<< ( const FloatT< V > &  val)
inline

Write FloatT value for current column in current row and move to next column.

  • The output will be empty/blank if val is null
Template Parameters
VType used with FloatT, inferred from argument
Parameters
valValue to write
Returns
This

◆ operator<<() [21/22]

This& operator<< ( Newline  )
inline

End current row.

  • This may be used to end the row early (leaving empty/blank cells)
  • The will end automatically on the last column so this is optional, but preferred to be explicit
  • Pass argument as NL
Returns
This

◆ operator<<() [22/22]

This& operator<< ( Flush  )
inline

Flush any cached output.

  • Caution: In some cases a stream can throw an exception (if enabled) during the flush so it's better to do flush explicitly with this
  • Pass argument as fFLUSH

Member Data Documentation

◆ out

T& out

Paired output string/stream to write to.

◆ writer

W writer

Writer to use with FmtTable.


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