16#include "SubComponent.h"
17#include "Interpreter.h"
18#include "TextStorage.h"
24class RetroShell :
public SubComponent {
26 Descriptions descriptions = {{
29 .description =
"Command Console"
32 friend class Interpreter;
35 Interpreter interpreter;
46 std::vector<std::pair<string,isize>> history;
60 std::vector<std::pair<isize,string>> commands;
63 string prompt =
"vc64% ";
69 bool tabPressed =
false;
77 std::stringstream script;
91 RetroShell& operator= (
const RetroShell& other) {
return *
this; }
100 template <
class T>
void serialize(T& worker) { } SERIALIZERS(serialize);
109 const Descriptions &getDescriptions()
const override {
return descriptions; }
113 void _dump(Category category, std::ostream& os)
const override { }
114 void _initialize()
override;
115 void _pause()
override;
125 RetroShell &operator<<(
char value);
126 RetroShell &operator<<(
const string &value);
127 RetroShell &operator<<(
int value);
128 RetroShell &operator<<(
unsigned int value);
129 RetroShell &operator<<(
long value);
130 RetroShell &operator<<(
unsigned long value);
131 RetroShell &operator<<(
long long value);
132 RetroShell &operator<<(
unsigned long long value);
133 RetroShell &operator<<(std::stringstream &stream);
136 const string &getPrompt();
148 void setStream(std::ostream &os);
175 isize inputLength() {
return (isize)input.length(); }
178 void press(RetroShellKey key,
bool shift =
false);
180 void press(
const string &s);
192 isize historyLength() {
return (isize)history.size(); }
202 void execUserCommand(
const string &command);
208 void exec(const
string &command, isize line = 0) throws;
211 void execScript(std::stringstream &ss) throws;
212 void execScript(const std::ifstream &fs) throws;
213 void execScript(const
string &contents) throws;
214 void execScript(const class MediaFile &script) throws;
220 void describe(const std::exception &exception, isize line = 0, const
string &cmd = "");
223 void help(const
string &command);
232 void dump(Dumpable &component, std::vector <Category> categories);
233 void dump(Dumpable &component, Category category);
237 void _dump(Dumpable &component, Category category);
VirtualC64 project namespace.
Definition CmdQueue.cpp:16