![]() |
NDEVR
API Documentation
|
A LogStream that writes log messages and progress to the standard output console. More...
Public Types | |
| enum | StdPrintType { e_none , e_print , e_print_and_wait } |
| Defines how messages are printed to the standard output. More... | |
Public Member Functions | |
| STDOutputStream () | |
| Constructs a default STDOutputStream. | |
| void | addMessage (uint04 id, const LogMessage &message) final override |
| Adds a log message and prints it to standard output based on the current print settings. | |
| void | clearLines (uint04 lines) const |
| Clears the specified number of lines from the console output. | |
| void | printLogo () |
| Prints the NDEVR ASCII logo to standard output. | |
| void | setProgress (uint04 id, fltp04 progress) final override |
| Updates the progress of an ongoing operation and prints a progress bar to standard output. | |
| Public Member Functions inherited from LogStream | |
| virtual | ~LogStream () |
| Destructor. | |
| virtual void | addMessages (uint04 id, const Buffer< LogMessage > &messages) |
| Adds multiple log messages to this stream at once. | |
| virtual void | addProgressSource (const TranslatedString &name, uint04 idx, fltp04 progress) |
| Registers a new progress source to be tracked by this stream. | |
| virtual void | allowCancel (bool) |
| Sets whether this stream allows the user to cancel an in-progress operation. | |
| virtual void | allowInput (bool) |
| Sets whether this stream allows user input during an operation. | |
| virtual void | attach (InfoPipe *stream) |
| Attaches this LogStream to the given InfoPipe so it receives log updates. | |
| void | clearLinks () |
| Detaches this LogStream from all linked InfoPipe objects and clears the link list. | |
| virtual void | detach (InfoPipe *stream) |
| Detaches this LogStream from the given InfoPipe, stopping further updates from it. | |
| bool | ignoringMessages () const |
| Returns whether this stream is currently ignoring messages. | |
| virtual void | removeProgressSource (uint04 idx) |
| Removes a previously registered progress source from this stream. | |
| void | setIgnoreMessages (bool ignore) |
| Sets whether this stream should ignore incoming messages. | |
Static Public Attributes | |
| static uint02 | s_max_print_message_size |
| The maximum number of characters to print per message. | |
| static bool | s_print_error_bars |
| Whether to print error progress bars to standard output. | |
| static StdPrintType | s_print_error_message |
| Controls how error messages are printed. | |
| static bool | s_print_loading_bars |
| Whether to print loading progress bars to standard output. | |
| static StdPrintType | s_print_regular_message |
| Controls how regular (non-error) messages are printed. | |
Additional Inherited Members | |
| Protected Attributes inherited from LogStream | |
| bool | m_ignore_message = false |
| Whether this stream should ignore incoming messages. | |
| Buffer< InfoPipe * > | m_linked_logs |
| Collection of InfoPipe objects this stream is listening to. | |
| Dictionary< uint04, ProgressSource > | m_progress_sources |
| Maps progress source indices to their ProgressSource data. | |
A LogStream that writes log messages and progress to the standard output console.
Definition at line 42 of file STDOutputStream.h.
Defines how messages are printed to the standard output.
| Enumerator | |
|---|---|
| e_none | Do not print the message. |
| e_print | Print the message to standard output. |
| e_print_and_wait | Print the message and wait for user acknowledgment. |
Definition at line 48 of file STDOutputStream.h.
|
finaloverridevirtual |
Adds a log message and prints it to standard output based on the current print settings.
| [in] | id | The identifier of the message entry. |
| [in] | message | The log message to add and display. |
Implements LogStream.
| void STDOutputStream::clearLines | ( | uint04 | lines | ) | const |
Clears the specified number of lines from the console output.
| [in] | lines | The number of lines to clear. |
Updates the progress of an ongoing operation and prints a progress bar to standard output.
| [in] | id | The identifier of the progress entry. |
| [in] | progress | The current progress value, typically between 0.0 and 1.0. |
Implements LogStream.