Writes to console using SC::StringFormat.
More...
#include <Console.h>
|
| | Console (Span< char > conversionBuffer={}) |
| | Constructs a console with an OPTIONAL conversion buffer used for UTF encoding conversions on Windows.
|
| |
| template<typename... Types> |
| bool | print (StringSpan fmt, Types &&... args) |
| | Prints a formatted string using SC::StringFormat to stdout.
|
| |
| template<typename... Types> |
| bool | printError (StringSpan fmt, Types &&... args) |
| | Prints a formatted string using SC::StringFormat to stderr.
|
| |
| void | print (const StringSpan str) |
| | Prints a string to console.
|
| |
| void | printError (const StringSpan str) |
| | Prints a string to stderr.
|
| |
| void | flush () |
| | Flushes stdout.
|
| |
| void | flushStdErr () |
| | Flushes stderr.
|
| |
| void | printLine (const StringSpan str) |
| | Prints a string to stdout and adds a newline at the end of it.
|
| |
| void | printErrorLine (const StringSpan str) |
| | Prints a string to stderr and adds a newline at the end of it.
|
| |
Writes to console using SC::StringFormat.
Example:
char optionalConversionBuffer[512];
Console console(optionalConversionBuffer);
console.print(str.
view());
Writes to console using SC::StringFormat.
Definition Console.h:26
Non-owning view over a range of characters with UTF Encoding.
Definition StringView.h:49
A non-modifiable owning string with associated encoding.
Definition String.h:28
StringSpan view() const SC_LANGUAGE_LIFETIME_BOUND
Obtain a null-terminated StringSpan from current String.
◆ Console()
| SC::Console::Console |
( |
Span< char > | conversionBuffer = {} | ) |
|
Constructs a console with an OPTIONAL conversion buffer used for UTF encoding conversions on Windows.
- Parameters
-
| conversionBuffer | The optional buffer used for UTF conversions |
◆ flush()
| void SC::Console::flush |
( |
| ) |
|
◆ flushStdErr()
| void SC::Console::flushStdErr |
( |
| ) |
|
◆ print() [1/2]
| void SC::Console::print |
( |
const StringSpan | str | ) |
|
Prints a string to console.
◆ print() [2/2]
template<typename... Types>
| bool SC::Console::print |
( |
StringSpan | fmt, |
|
|
Types &&... | args ) |
|
inline |
Prints a formatted string using SC::StringFormat to stdout.
- Returns
true if message has been printed successfully to Console
◆ printError() [1/2]
| void SC::Console::printError |
( |
const StringSpan | str | ) |
|
Prints a string to stderr.
◆ printError() [2/2]
template<typename... Types>
| bool SC::Console::printError |
( |
StringSpan | fmt, |
|
|
Types &&... | args ) |
|
inline |
Prints a formatted string using SC::StringFormat to stderr.
- Returns
true if message has been printed successfully to Console
◆ printErrorLine()
| void SC::Console::printErrorLine |
( |
const StringSpan | str | ) |
|
Prints a string to stderr and adds a newline at the end of it.
◆ printLine()
| void SC::Console::printLine |
( |
const StringSpan | str | ) |
|
Prints a string to stdout and adds a newline at the end of it.
◆ tryAttachingToParentConsole()
| static bool SC::Console::tryAttachingToParentConsole |
( |
| ) |
|
|
static |
Tries attaching current process to parent console (Windows only, has no effect elsewhere)
- Returns
true if the parent console has been attached (Windows only, returns true elsewhere)
The documentation for this struct was generated from the following file: