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
 Write list using open, close and separator characters specified by Delimiters template, which generally results in a single line without line breaks. More...
 

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

Constructor & Destructor Documentation

◆ OutputAdaptor()

OutputAdaptor ( const Container &  obj)
inlineexplicit

Construct from component.

Definition at line 141 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 158 of file FlatOutput.H.

References os().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

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

Ostream Operator.

Definition at line 198 of file FlatOutput.H.


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