42 <<
"Ostream::decrIndent() : attempt to decrement 0 indent level\n";
53 const std::string& str,
70 writeQuoted(kw.data(), kw.size(), kw.
isPattern());
78 label padding = (entryIndentation_ - label(kw.size()));
91 while (--padding > 0);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static constexpr const unsigned short entryIndentation_
Indentation of the entry from the start of the keyword.
virtual Ostream & endBlock()
Write end block group.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true)=0
Write character/string content, with/without surrounding quotes.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
unsigned short indentSize_
Number of spaces per indent level.
virtual Ostream & beginBlock()
Write begin block group without a name.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
void decrIndent()
Decrement the indent level.
unsigned short indentLevel_
Current indent level.
virtual Ostream & endEntry()
Write end entry (';') followed by newline.
A class for handling keywords in dictionaries.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ END_STATEMENT
End entry [isseparator].
Ostream & beginBlock(Ostream &os)
Write begin block group without a name.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & indent(Ostream &os)
Indent stream.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.