![]() |
Rishka
RISC-V virtual runtime in C/C++ made for ESP32-WROVER
|
Class for handling input/output operations in Rishka applications. More...
#include <io.h>
Static Public Member Functions | |
| static void | print (const string text) |
| Print text to the output stream. More... | |
| static void | print (const string text, const string fg, const string bg=TERM_BG_BLACK, const string style=TERM_STYLE_NORMAL) |
| Print text to the output stream. More... | |
| static void | println (const string text) |
| Print text to the output stream. More... | |
| static void | print (i64 number) |
| Print an integer number to the output stream. More... | |
| static void | println (i64 number) |
| Print an integer number to the output stream. More... | |
| static void | print (u64 number) |
| Print an unsigned number to the output stream. More... | |
| static void | println (u64 number) |
| Print an unsigned number to the output stream. More... | |
| static void | print (double number) |
| Print a floating-point number to the output stream. More... | |
| static void | println (double number) |
| Print a floating-point number to the output stream. More... | |
| static void | println () |
| Prints a new line to the output stream. More... | |
| static bool | printf (string format,...) |
| Prints formatted output. More... | |
| static i32 | available () |
| Check if there is data available to read from the input stream. More... | |
| static i32 | peek () |
| Peek at the next character in the input stream. More... | |
| static bool | find (string target, usize size) |
| Search for a target string in the input stream. More... | |
| static bool | find_until (string target, string terminator) |
| Search for a target string in the input stream until a terminator is encountered. More... | |
| static void | set_timeout (u64 timeout) |
| Set the timeout for input operations. More... | |
| static u64 | get_timeout () |
| Get the current timeout for input operations. More... | |
| static rune | readch () |
| Read a Unicode character from the input stream. More... | |
| static string | readline () |
| Read a line of text from the input stream. More... | |
Class for handling input/output operations in Rishka applications.
The IO class provides static methods for performing input/output operations, such as printing text and numbers, reading input, searching for patterns, and setting timeouts for input operations on ESP32-WROVER microcontrollers.
|
static |
Check if there is data available to read from the input stream.
This method checks if there is data available to read from the input stream.
Search for a target string in the input stream.
This method searches for the specified target string in the input stream.
| target | The target string to search for. |
| size | The size of the target string. |
Search for a target string in the input stream until a terminator is encountered.
This method searches for the specified target string in the input stream until the specified terminator string is encountered.
| target | The target string to search for. |
| terminator | The terminator string. |
|
static |
Get the current timeout for input operations.
This method returns the current timeout for input operations in microseconds.
|
static |
Peek at the next character in the input stream.
This method peeks at the next character in the input stream without removing it.
|
static |
Print text to the output stream.
This method prints the specified text to the output stream.
| text | The text to be printed. |
|
static |
Print text to the output stream.
This method prints the specified text to the output stream with specified foreground color, background color, and style.
| text | The text to be printed. |
| fg | Foreground color of the output text. |
| bg | Background color of the output text. |
| style | Style/format of the output. |
|
static |
Print a floating-point number to the output stream.
This method prints the specified floating-point number to the output stream.
| number | The floating-point number to be printed. |
|
static |
Print an integer number to the output stream.
This method prints the specified integer number to the output stream.
| number | The integer number to be printed. |
|
static |
Print an unsigned number to the output stream.
This method prints the specified unsigned number to the output stream.
| number | The unsigned number to be printed. |
|
static |
Prints formatted output.
This method prints formatted output to the standard output stream. It behaves similar to the printf function in C/C++, allowing developers to specify a format string and additional arguments for formatting.
Formatters:
{i} — Integer number value{u} — Unsigned number value{d} — Double or floating-point number{s} — String value| format | A string specifying the format of the output. |
| ... | Additional arguments to be formatted according to the format string. |
|
static |
Prints a new line to the output stream.
THis method prints a new line to the current output stream.
|
static |
Print text to the output stream.
This method prints the specified text to the output stream followed by a new line.
| text | The text to be printed. |
|
static |
Print a floating-point number to the output stream.
This method prints the specified floating-point number to the output stream followed by a new line.
| number | The floating-point number to be printed. |
|
static |
Print an integer number to the output stream.
This method prints the specified integer number to the output stream followed by a new line.
| number | The integer number to be printed. |
|
static |
Print an unsigned number to the output stream.
This method prints the specified unsigned number to the output stream followed by a new line.
| number | The unsigned number to be printed. |
|
static |
Read a Unicode character from the input stream.
This method reads a Unicode character from the input stream.
|
static |
Read a line of text from the input stream.
This method reads a line of text from the input stream.
|
static |
Set the timeout for input operations.
This method sets the timeout for input operations in microseconds.
| timeout | The timeout value in microseconds. |