48template<
class Container,
class Delimiters>
class OutputAdaptor;
54template<
class Container,
class Delimiters>
70template<
char OpenChar,
char CloseChar,
char SepChar>
73 static constexpr char open = OpenChar;
74 static constexpr char close = CloseChar;
80#define makeDecorator(Name, Open, Close, Sep) \
82 struct Name : public Decorators<Open, Close, Sep> {};
125template<
class Container,
class Delimiters>
131 const Container& values;
154 bool started =
false;
158 if (Delimiters::open)
160 os << Delimiters::open;
162 for (
const auto& item : values)
166 if (Delimiters::separator)
168 os << Delimiters::separator;
177 if (Delimiters::close)
179 os << Delimiters::close;
212template<
class Container,
class Delimiters>
213inline FlatOutput::OutputAdaptor<Container, Delimiters>
216 const Container& obj,
225template<
class Container>
226inline FlatOutput::OutputAdaptor<Container, FlatOutput::ParenSpace>
#define makeDecorator(Name, Open, Close, Sep)
An output adaptor with a write method and an Ostream operator.
Ostream & write(Ostream &os) const
OutputAdaptor(const Container &obj)
Construct from component.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
OBJstream os(runTime.globalPath()/outputName)
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.
constexpr char nl
The newline '\n' character (0x0a)
Surround with '\0' and '\0' separate with ','.
Surround with '\0' and '\0' separate with ' '.
Surround with '{' and '}' separate with ','.
Surround with '{' and '}' separate with ' '.
List decorators with open, close and separator characters.
static constexpr char close
static constexpr char separator
static constexpr char open
Surround with '(' and ')' separate with ','.
Surround with '(' and ')' separate with ' '.
Surround with '<' and '>' separate with ','.
Surround with '<' and '>' separate with ' '.
Surround with '[' and ']' separate with ','.
Surround with '[' and ']' separate with ' '.