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
 

Friends

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 */
Info<< flatOutput(names, FlatOutput::SquareComma{}) << nl;
/* User-specified delimiters */
Info<< flatOutput(names, FlatOutput::Decorators<'[',')',':'>{}) << nl;

Definition at line 48 of file FlatOutput.H.

Constructor & Destructor Documentation

◆ OutputAdaptor()

OutputAdaptor ( const Container &  obj)
inlineexplicit

Construct from component.

Definition at line 139 of file FlatOutput.H.

Member Function Documentation

◆ write()

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 153 of file FlatOutput.H.

Friends And Related Function Documentation

◆ operator<<

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

Ostream Operator.

Definition at line 191 of file FlatOutput.H.


The documentation for this class was generated from the following file:
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::flatOutput
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:216
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::PtrListOps::names
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)