Appearance
InputLine
cpp
#include <Misc/RetroShell/RetroShellTypes.h>cpp
struct InputLineDefined in Misc/RetroShell/RetroShellTypes.h:111
A line of input for a RetroShell console, together with its source.
Public Attributes
| Return | Name | Description |
|---|---|---|
isize | id | Line number, RPC identifier, etc. |
Source | type | Indicates where the command comes from. |
string | input | The command to execute. |
Completion | completion | Completion handler of the command. |
id
cpp
isize idDefined in Misc/RetroShell/RetroShellTypes.h:123
Line number, RPC identifier, etc.
type
cpp
Source typeType: Source
Defined in Misc/RetroShell/RetroShellTypes.h:126
Indicates where the command comes from.
input
cpp
string inputDefined in Misc/RetroShell/RetroShellTypes.h:129
The command to execute.
completion
cpp
Completion completionType: Completion
Defined in Misc/RetroShell/RetroShellTypes.h:142
Completion handler of the command.
Public Methods
| Return | Name | Description |
|---|---|---|
bool | isUserCommand const inline | Returns true if the line was typed in by the user. |
bool | isScriptCommand const inline | Returns true if the line comes from a script. |
bool | isRpcCommand const inline | Returns true if the line is a JSON RPC request. |
bool | isRshCommand const inline | Returns true if the line is a RemoteShell request. |
bool | isComment const inline | Returns true if the line is a comment. |
isUserCommand
const inline
cpp
inline bool isUserCommand() constDefined in Misc/RetroShell/RetroShellTypes.h:145
Returns true if the line was typed in by the user.
isScriptCommand
const inline
cpp
inline bool isScriptCommand() constDefined in Misc/RetroShell/RetroShellTypes.h:147
Returns true if the line comes from a script.
isRpcCommand
const inline
cpp
inline bool isRpcCommand() constDefined in Misc/RetroShell/RetroShellTypes.h:149
Returns true if the line is a JSON RPC request.
isRshCommand
const inline
cpp
inline bool isRshCommand() constDefined in Misc/RetroShell/RetroShellTypes.h:151
Returns true if the line is a RemoteShell request.
isComment
const inline
cpp
inline bool isComment() constDefined in Misc/RetroShell/RetroShellTypes.h:153
Returns true if the line is a comment.
Public Types
| Name | Description |
|---|---|
Source | Origin of a RetroShell input line. |
Completion | Completion handler (may be empty). |
Source
cpp
enum SourceDefined in Misc/RetroShell/RetroShellTypes.h:114
Origin of a RetroShell input line.
| Value | Description |
|---|---|
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.