Emit a newline and indentation to the specified stream.
Declared in <bdlb_print.h>
static
std::ostream&
newlineAndIndent(
std::ostream& stream,
int level,
int spacesPerLevel = 4);
Emit to the specified stream a newline (`
`) followed by the number of spaces ( ) equal to the absolute value of the product of the specified level and spacesPerLevel or, if spacesPerLevel is negative, emit a single space (and no newline). Return a reference providing modifiable access to stream. The behavior is undefined unless the absolute value of the product of the specified level and spacesPerLevel is representable as int.
a reference to stream
| Name | Description |
|---|---|
| stream | the output stream |
| level | the indentation level |
| spacesPerLevel | spaces per indentation level |