VirtualC64 v5.0 beta
Commodore 64 Emulator
|
RetroShell Public API. More...
#include <VirtualC64.h>
Public Member Functions | |
Querying the console | |
const char * | text () |
Returns a pointer to the text buffer. | |
isize | cursorRel () |
Returns the relative cursor position. | |
Typing characters and strings | |
void | press (RetroShellKey key, bool shift=false) |
Informs RetroShell that a key has been typed. | |
void | press (char c) |
Informs RetroShell that a key has been typed. | |
void | press (const string &s) |
Informs RetroShell that multiple keys have been typed. | |
Controlling the output stream | |
void | setStream (std::ostream &os) |
Assign an additional output stream. | |
Executing scripts | |
void | execScript (std::stringstream &ss) |
Executes a script. | |
void | execScript (const std::ifstream &fs) |
Executes a script. | |
void | execScript (const string &contents) |
Executes a script. | |
void | execScript (const MediaFile &file) |
Executes a script. | |
RetroShell Public API.
isize cursorRel | ( | ) |
Returns the relative cursor position.
The returned value is relative to the end of the input line. A value of 0 indicates that the cursor is at the rightmost position, that is, one character after the last character of the input line. If the cursor is at the front of the input line, the value matches the length of the input line.
void execScript | ( | const MediaFile & | file | ) |
Executes a script.
The script is executes asynchroneously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last script command has been executed, MSG_SCRIPT_DONE is sent. If shell execution has been aborted due to an error, MSG_SCRIPT_ABORT is sent.
void execScript | ( | const std::ifstream & | fs | ) |
Executes a script.
The script is executes asynchroneously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last script command has been executed, MSG_SCRIPT_DONE is sent. If shell execution has been aborted due to an error, MSG_SCRIPT_ABORT is sent.
void execScript | ( | const string & | contents | ) |
Executes a script.
The script is executes asynchroneously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last script command has been executed, MSG_SCRIPT_DONE is sent. If shell execution has been aborted due to an error, MSG_SCRIPT_ABORT is sent.
void execScript | ( | std::stringstream & | ss | ) |
Executes a script.
The script is executes asynchroneously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last script command has been executed, MSG_SCRIPT_DONE is sent. If shell execution has been aborted due to an error, MSG_SCRIPT_ABORT is sent.
void press | ( | char | c | ) |
Informs RetroShell that a key has been typed.
c | The pressed key |
void press | ( | const string & | s | ) |
Informs RetroShell that multiple keys have been typed.
s | The typed text |
void press | ( | RetroShellKey | key, |
bool | shift = false ) |
Informs RetroShell that a key has been typed.
key | The pressed key |
shift | Status of the shift key |
void setStream | ( | std::ostream & | os | ) |
Assign an additional output stream.
In addition to writing the RetroShell output into the text buffer, RetroShell will write the output into the provides stream.
const char * text | ( | ) |
Returns a pointer to the text buffer.
The text buffer contains the complete contents of the console. It will be expanded when new output is generated. When the buffer grows too large, old contents is cropped.