Appearance
RetroShellAPI
cpp
#include <VAmiga.h>cpp
class RetroShellAPIDefined in VAmiga.h:2307
RetroShell Public API
Public Methods
| Return | Name | Description |
|---|---|---|
const RetroShellInfo & | getInfo const | Returns the component's current state. |
const RetroShellInfo & | getCachedInfo const | Returns the most recent state snapshot recorded by the emulator thread (see getInfo()). |
string | text const | Returns a copy of 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. |
void | press | Informs RetroShell that a key has been typed. |
void | press | Informs RetroShell that a key has been typed. |
void | press | Informs RetroShell that multiple keys have been typed. |
void | setStream | 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. |
void | execScriptAsync | Executes a script. The script is executed asynchronously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last pending command has been executed, Msg::RSH_DONE is sent. If a command fails, the remaining commands are dropped and Msg::RSH_ERROR is sent instead. A 'wait' command postpones the rest of the script and sends Msg::RSH_WAIT. |
void | execScriptAsync | Executes a script provided by a string stream (see execScriptAsync()). |
void | execScriptAsync | Executes a script provided by a file stream (see execScriptAsync()). |
void | execScriptAsync | Executes a script provided as a string (see execScriptAsync()). |
void | exportBlocks | Installs a file system in the file system navigator. |
getInfo
const
cpp
const RetroShellInfo & getInfo() constDefined in VAmiga.h:2328
Returns the component's current state.
getInfo() reads the live state on the calling thread. The result is only consistent if the emulator is paused or suspended. getCachedInfo() returns the snapshot the emulator thread has recorded most recently, which is the one to use while the emulator runs. Both return references that can be overwritten by a later call or by the emulator thread, so copy the data if you need to keep it.
getCachedInfo
const
cpp
const RetroShellInfo & getCachedInfo() constDefined in VAmiga.h:2330
Returns the most recent state snapshot recorded by the emulator thread (see getInfo()).
text
const
cpp
string text() constDefined in VAmiga.h:2337
Returns a copy of 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.
press
cpp
void press(RSKey key, bool shift = false)Defined in VAmiga.h:2347
Informs RetroShell that a key has been typed.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | RSKey | The pressed key |
shift | bool | Status of the shift key |
press
cpp
void press(char c)Defined in VAmiga.h:2352
Informs RetroShell that a key has been typed.
Parameters
| Parameter | Type | Description |
|---|---|---|
c | char | The pressed key |
press
cpp
void press(const string & s)Defined in VAmiga.h:2357
Informs RetroShell that multiple keys have been typed.
Parameters
| Parameter | Type | Description |
|---|---|---|
s | const string & | The typed text |
setStream
cpp
void setStream(std::ostream & os)Defined in VAmiga.h:2367
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.
execScriptAsync
cpp
void execScriptAsync(const std::filesystem::path & path)Defined in VAmiga.h:2383
Executes a script. The script is executed asynchronously. However, RetroShell will send messages back to the GUI thread to inform about the execution state. After the last pending command has been executed, Msg::RSH_DONE is sent. If a command fails, the remaining commands are dropped and Msg::RSH_ERROR is sent instead. A 'wait' command postpones the rest of the script and sends Msg::RSH_WAIT.
Exceptions
| Exception | Description |
|---|---|
Error | if the file cannot be opened. |
execScriptAsync
cpp
void execScriptAsync(std::stringstream & ss)Defined in VAmiga.h:2385
Executes a script provided by a string stream (see execScriptAsync()).
execScriptAsync
cpp
void execScriptAsync(const std::ifstream & fs)Defined in VAmiga.h:2387
Executes a script provided by a file stream (see execScriptAsync()).
execScriptAsync
cpp
void execScriptAsync(const string & contents)Defined in VAmiga.h:2389
Executes a script provided as a string (see execScriptAsync()).
exportBlocks
cpp
void exportBlocks(const std::filesystem::path & path)Defined in VAmiga.h:2410
Installs a file system in the file system navigator.
Exports the file system in the file system navigator
Exceptions
| Exception | Description |
|---|---|
Error | if the file cannot be written. |