OutputAdaptor< Container, Delimiters > Class Template Reference

An output adaptor with a write method and an Ostream operator. More...

Public Member Functions

 OutputAdaptor (const Container &obj)
 Construct from component. More...
Ostreamwrite (Ostream &os) const


Ostreamoperator<< (Ostream &os, const OutputAdaptor< Container, Delimiters > &adaptor)
 Ostream Operator. More...

Detailed Description

template<class Container, class Delimiters>
class Foam::FlatOutput::OutputAdaptor< Container, Delimiters >

An output adaptor with a write method and an Ostream operator.

Generate single line (flat) output using the characters specified by the templated Delimiters. Normally called with the global flatOutput() function. For example,

/* With default parenthesis/space delimiters */
Info<< "Names: " << flatOutput(names) << nl;
/* Other delimiters */
/* User-specified delimiters */
Info<< flatOutput(names, FlatOutput::Decorators<'[',')',':'>{}) << nl;
messageStream Info
Information stream (stdout output on master, null elsewhere)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:215
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
List decorators with open, close and separator characters.
Definition: FlatOutput.H:72
Surround with '[' and ']' separate with ','.
Definition: FlatOutput.H:96

Definition at line 126 of file FlatOutput.H.

Constructor & Destructor Documentation

◆ OutputAdaptor()

OutputAdaptor ( const Container &  obj)

Construct from component.

Definition at line 138 of file FlatOutput.H.

Member Function Documentation

◆ write()

Ostream & write ( Ostream os) const

Write list using open, close and separator characters specified by Delimiters template, which generally results in a single line without line breaks.

Suppresses nul char output. No special handling for newline separators.

Definition at line 152 of file FlatOutput.H.

Friends And Related Function Documentation

◆ operator<<

Ostream & operator<< ( Ostream os,
const OutputAdaptor< Container, Delimiters > &  adaptor 

Ostream Operator.

Definition at line 189 of file FlatOutput.H.

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