Skip to content

InputLine ​

cpp
#include <Misc/RetroShell/RetroShellTypes.h>
cpp
struct InputLine

Defined in Misc/RetroShell/RetroShellTypes.h:111

A line of input for a RetroShell console, together with its source.

Public Attributes ​

ReturnNameDescription
isizeidLine number, RPC identifier, etc.
SourcetypeIndicates where the command comes from.
stringinputThe command to execute.
CompletioncompletionCompletion handler of the command.

id ​

cpp
isize id

Defined in Misc/RetroShell/RetroShellTypes.h:123

Line number, RPC identifier, etc.


type ​

cpp
Source type

Type: Source

Defined in Misc/RetroShell/RetroShellTypes.h:126

Indicates where the command comes from.


input ​

cpp
string input

Defined in Misc/RetroShell/RetroShellTypes.h:129

The command to execute.


completion ​

cpp
Completion completion

Type: Completion

Defined in Misc/RetroShell/RetroShellTypes.h:142

Completion handler of the command.

Public Methods ​

ReturnNameDescription
boolisUserCommand const inlineReturns true if the line was typed in by the user.
boolisScriptCommand const inlineReturns true if the line comes from a script.
boolisRpcCommand const inlineReturns true if the line is a JSON RPC request.
boolisRshCommand const inlineReturns true if the line is a RemoteShell request.
boolisComment const inlineReturns true if the line is a comment.

isUserCommand ​

const inline

cpp
inline bool isUserCommand() const

Defined in Misc/RetroShell/RetroShellTypes.h:145

Returns true if the line was typed in by the user.


isScriptCommand ​

const inline

cpp
inline bool isScriptCommand() const

Defined in Misc/RetroShell/RetroShellTypes.h:147

Returns true if the line comes from a script.


isRpcCommand ​

const inline

cpp
inline bool isRpcCommand() const

Defined in Misc/RetroShell/RetroShellTypes.h:149

Returns true if the line is a JSON RPC request.


isRshCommand ​

const inline

cpp
inline bool isRshCommand() const

Defined in Misc/RetroShell/RetroShellTypes.h:151

Returns true if the line is a RemoteShell request.


isComment ​

const inline

cpp
inline bool isComment() const

Defined in Misc/RetroShell/RetroShellTypes.h:153

Returns true if the line is a comment.

Public Types ​

NameDescription
SourceOrigin of a RetroShell input line.
CompletionCompletion handler (may be empty).

Source ​

cpp
enum Source

Defined in Misc/RetroShell/RetroShellTypes.h:114

Origin of a RetroShell input line.

ValueDescription
USER
SCRIPT
RPC
RSH

Completion ​

cpp
using Completion = std::function< void(const string &output, std::exception_ptr error)>

Defined in Misc/RetroShell/RetroShellTypes.h:140

Completion handler (may be empty).

Called on the emulator thread once the command has been executed, with the console output and a null exception pointer on success, or with the exception on failure. A command that is dropped without being executed (e.g., because a previous command of the same batch failed) is completed with that failure. The handler runs while the shell is locked, so it must be short and must not block.