Loading...
Searching...
No Matches
OutputAdaptor< Container, Delimiters > Class Template Reference

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

#include <FlatOutput.H>

Public Member Functions

 OutputAdaptor (const Container &obj) noexcept
 Construct from const reference.
Ostreamwrite (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.

Friends

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

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 */
auto & names
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:217
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
List decorators with open, close and separator characters.
Definition FlatOutput.H:68
Surround with '[' and ']' separate with ','.
Definition FlatOutput.H:92

Definition at line 125 of file FlatOutput.H.

Constructor & Destructor Documentation

◆ OutputAdaptor()

template<class Container, class Delimiters>
OutputAdaptor ( const Container & obj)
inlineexplicitnoexcept

Construct from const reference.

Definition at line 141 of file FlatOutput.H.

References Foam::noexcept.

Referenced by operator<<.

Here is the caller graph for this function:

Member Function Documentation

◆ write()

template<class Container, class Delimiters>
Ostream & write ( Ostream & os) const
inline

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

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

Definition at line 158 of file FlatOutput.H.

References os().

Here is the call graph for this function:

◆ operator<<

template<class Container, class Delimiters>
Ostream & operator<< ( Ostream & os,
const OutputAdaptor< Container, Delimiters > & adaptor )
friend

Ostream Operator.

Definition at line 189 of file FlatOutput.H.

References os(), and OutputAdaptor().


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