48 template<
class Container,
class Delimiters>
class OutputAdaptor;
54 template<
class Container,
class Delimiters>
70 template<
char OpenChar,
char CloseChar,
char SepChar>
73 static constexpr
char open = OpenChar;
74 static constexpr
char close = CloseChar;
75 static constexpr
char separator = SepChar;
80 #define makeDecorator(Name, Open, Close, Sep) \ 82 struct Name : public Decorators<Open, Close, Sep> {}; 125 template<
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;
189 friend Ostream&
operator<<
192 const OutputAdaptor<Container, Delimiters>& adaptor
195 return adaptor.write(
os);
212 template<
class Container,
class Delimiters>
213 inline FlatOutput::OutputAdaptor<Container, Delimiters>
216 const Container& obj,
220 return FlatOutput::OutputAdaptor<Container, Delimiters>(obj);
225 template<
class Container>
static constexpr char open
Surround with '{' and '}' separate with ','.
Surround with '[' and ']' separate with ' '.
Surround with '\0' and '\0' separate with ' '.
Surround with '\0' and '\0' separate with ','.
static constexpr char close
Surround with '{' and '}' separate with ' '.
An output adaptor with a write method and an Ostream operator.
static constexpr char separator
OutputAdaptor(const Container &obj)
Construct from component.
#define makeDecorator(Name, Open, Close, Sep)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Surround with '<' and '>' separate with ','.
OBJstream os(runTime.globalPath()/outputName)
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.
List decorators with open, close and separator characters.
Surround with '(' and ')' separate with ','.
Surround with '[' and ']' separate with ','.
Surround with '<' and '>' separate with ' '.
Surround with '(' and ')' separate with ' '.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.