Skip to content

RetroShellAPI ​

cpp
#include <VAmiga.h>
cpp
class RetroShellAPI

Defined in VAmiga.h:2307

RetroShell Public API

Public Methods ​

ReturnNameDescription
const RetroShellInfo &getInfo constReturns the component's current state.
const RetroShellInfo &getCachedInfo constReturns the most recent state snapshot recorded by the emulator thread (see getInfo()).
stringtext constReturns 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.
voidpressInforms RetroShell that a key has been typed.
voidpressInforms RetroShell that a key has been typed.
voidpressInforms RetroShell that multiple keys have been typed.
voidsetStreamAssign an additional output stream. In addition to writing the RetroShell output into the text buffer, RetroShell will write the output into the provides stream.
voidexecScriptAsyncExecutes 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.
voidexecScriptAsyncExecutes a script provided by a string stream (see execScriptAsync()).
voidexecScriptAsyncExecutes a script provided by a file stream (see execScriptAsync()).
voidexecScriptAsyncExecutes a script provided as a string (see execScriptAsync()).
voidexportBlocksInstalls a file system in the file system navigator.

getInfo ​

const

cpp
const RetroShellInfo & getInfo() const

Defined 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() const

Defined in VAmiga.h:2330

Returns the most recent state snapshot recorded by the emulator thread (see getInfo()).


text ​

const

cpp
string text() const

Defined 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 ​

ParameterTypeDescription
keyRSKeyThe pressed key
shiftboolStatus of the shift key

press ​

cpp
void press(char c)

Defined in VAmiga.h:2352

Informs RetroShell that a key has been typed.

Parameters ​

ParameterTypeDescription
ccharThe pressed key

press ​

cpp
void press(const string & s)

Defined in VAmiga.h:2357

Informs RetroShell that multiple keys have been typed.

Parameters ​

ParameterTypeDescription
sconst 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 ​

ExceptionDescription
Errorif 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 ​

ExceptionDescription
Errorif the file cannot be written.