19 #include <uuid/console.h>
34 return write(
reinterpret_cast<const uint8_t*
>(data.c_str()), data.length());
39 size_t len =
print(data);
48 size_t len =
vprintf(format, ap);
58 size_t len =
vprintf(format, ap);
68 size_t len =
vprintf(format, ap);
79 size_t len =
vprintf(format, ap);
92 int format_len = ::vsnprintf(
nullptr, 0, format, ap);
94 std::string text(
static_cast<std::string::size_type
>(format_len),
'\0');
96 ::vsnprintf(&text[0], text.capacity() + 1, format, copy_ap);
97 print_len =
print(text);
105 size_t print_len = 0;
108 va_copy(copy_ap, ap);
110 int format_len = ::vsnprintf_P(
nullptr, 0,
reinterpret_cast<PGM_P
>(format), ap);
111 if (format_len > 0) {
112 std::string text(
static_cast<std::string::size_type
>(format_len),
'\0');
114 ::vsnprintf_P(&text[0], text.capacity() + 1,
reinterpret_cast<PGM_P
>(format), copy_ap);
115 print_len =
print(text);
124 CommandLine command_line{available_command.name(), available_command.arguments()};
132 print(F(
"\033[G\033[K"));
136 print(std::string(count,
'\x08'));
size_t maximum_command_line_length() const
Get the maximum length of a command line.
Representation of a command line, with parameters separated by spaces and an optional trailing space.
Commands::AvailableCommands available_commands() const
Get the available commands in the current context and with the current flags.
size_t print(const std::string &data)
Output a string.
void escape_initial_parameters()
Only escape the number of parameters that currently exist when formatting the command line for output...
size_t printfln(const char *format,...)
Output a message followed by CRLF end of line characters.
size_t println(const std::string &data)
Output a string followed by CRLF end of line characters.
size_t vprintf(const char *format, va_list ap)
Output a message.
size_t printf(const char *format,...)
Output a message.
void print_all_available_commands()
Output a list of all available commands with their arguments.
size_t write(uint8_t data) final override
Write one byte to the output stream.
virtual void erase_current_line()
Output ANSI escape sequence to erase the current line.
virtual void erase_characters(size_t count)
Output ANSI escape sequence to erase characters.