Go to the documentation of this file.
50 mutex_(new wxMutex()),
51 input_(new wxCondition(*mutex_)),
77 std::string defPrompt, FILE*, FILE*, FILE*) {
79 gui_ = wxGetApp().GetTopWindow();
100 std::string method =
"ProximLineReader::readLine";
149 std::string question, std::string allowedChars,
161 output(question +
" [" + allowedChars +
"]? ");
169 if (answer.length() != 1) {
172 }
while (allowedChars.find(answer, 0) == std::string::npos);
196 wxPostEvent(
gui_, event);
225 lineReader_(lineReader),
253 if(pbase() == epptr()) {
280 if (pbase() != pptr()) {
282 int len = pptr() - pbase();
283 char* buffer =
new char[len+1];
284 strncpy(buffer, pbase(), len);
287 setp(pbase(), epptr());
static const std::string DEFAULT_LOG_FILE_NAME
virtual ~ProximLROutputBuffer()
std::string historyFile_
Name of the input history file.
ProximLineReader * lineReader_
ProximLROutputBuffer(ProximLineReader *lineReader)
const unsigned int BUFFER_SIZE
std::ostream * outputStream_
Output stream which converts the output to SimulatorEvents.
static void setOutputStream(std::ostream &newOutputStream)
void putInInputHistory(const std::string &inputLine)
std::queue< std::string > inputQueue_
Input queue.
virtual void setInputHistoryLog(const std::string &historyFilename)
void input(std::string command)
static const wxEventType EVT_SIMULATOR_OUTPUT
Textual output event from simulator interpreter.
virtual void setInputHistoryLog(const std::string &historyFilename)
virtual ~ProximLineReader()
std::string inputHistoryFilename() const
virtual char charQuestion(std::string question, std::string allowedChars, bool caseSensitive=false, char defaultAnswer='\0')
virtual void initialize(std::string defPrompt="", FILE *in=stdin, FILE *out=stdout, FILE *err=stderr)
void output(std::string text)
wxEvtHandler * gui_
GUI to send the events to.
virtual std::ostream & outputStream()
virtual std::string readLine(std::string prompt="")
ProximLROutputStream(ProximLineReader *lineReader)
virtual ~ProximLROutputStream()
std::string prompt_
Input prompt.
wxCondition * input_
Condition, which is signaled when user input is received from the GUI.