Output file stream with indentation.
More...
#include <IndentedOut.h>
Inherits std::ofstream.
|
| IndentedOut () |
| Default constructor.
|
|
| IndentedOut (const std::filesystem::path &file) |
|
| ~IndentedOut () |
| Destructor.
|
|
void | open (const std::filesystem::path &file) |
| Opens the file.
|
|
void | close () |
| Closes the file.
|
|
void | indent () noexcept |
| Increase indentation.
|
|
void | unindent () noexcept |
| Decrease indentation.
|
|
void | empty_line () |
| Ensure that empty line inserted at the current position.
|
|
unsigned | indentation () const noexcept |
|
char | last_char () const noexcept |
|
size_t | size () const noexcept |
|
Output file stream with indentation.
- Examples
- Printer.cpp.
Definition at line 39 of file IndentedOut.h.
◆ IndentedOut()
BE::IndentedOut::IndentedOut |
( |
const std::filesystem::path & |
file | ) |
|
Constructor.
- Parameters
-
- Exceptions
-
◆ open()
void BE::IndentedOut::open |
( |
const std::filesystem::path & |
file | ) |
|
Opens the file.
Also creates all parent directories.
- Parameters
-
- Exceptions
-
◆ indentation()
unsigned BE::IndentedOut::indentation |
( |
| ) |
const |
|
inlinenoexcept |
◆ last_char()
char BE::IndentedOut::last_char |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The last output character.
Definition at line 93 of file IndentedOut.h.
◆ size()
size_t BE::IndentedOut::size |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The number of characters written.
Definition at line 99 of file IndentedOut.h.
The documentation for this class was generated from the following file: