Go to the documentation of this file.
93 std::string defPrompt,
116 history(
history_, &ev, H_SETSIZE, 100);
137 string message =
"LineReader not initialized";
141 char* oldPrompt = NULL;
148 const char* c = el_gets(
editLine_, &count);
150 bool endOfFile = (c == NULL || strlen(c) == 0 || feof(
in_));
152 string message =
"End of file.";
158 if (oldPrompt != NULL) {
181 std::string question, std::string allowedChars,
bool caseSensitive,
182 char defaultAnswer) {
184 string method =
"EditLineReader::charQuestion()";
185 string message =
"LineReader not initialized";
192 if (defaultAnswer ==
'\0') {
193 const char* answer =
nullptr;
197 }
while (strlen(answer) != 1 &&
199 containsChar(allowedChars, answer[0], caseSensitive));
206 const char* answer =
nullptr;
210 if (answer ==
nullptr) {
214 return defaultAnswer;
216 if (strlen(answer) != 1 &&
218 containsChar(allowedChars, answer[0], caseSensitive)) {
223 return defaultAnswer;
272 string entry(newEntry);
276 history(
history_, &ev, H_ENTER, newEntry);
std::string program_
The name of the invocating program.
virtual void initialize(std::string defPrompt="", FILE *in=stdin, FILE *out=stdout, FILE *err=stderr)
History * history_
History instance.
void updateHistory(const char *c)
void putInInputHistory(const std::string &inputLine)
EditLine * editLine_
EditLine instance.
std::map< EditLine *, EditLineReader * >::value_type ValType
value_type for map.
static char * wrapperToCallPrompt(EditLine *edit)
#define assert(condition)
std::map< EditLine *, EditLineReader * >::iterator MapIt
Iterator for map.
virtual std::string readLine(std::string prompt="")
FILE * in_
Input stream is saved for end-of-file checking.
virtual ~EditLineReader()
EditLineReader(std::string program="")
char * prompt_
Line reader prompt.
find Finds info of the inner loops in the program
virtual char charQuestion(std::string question, std::string allowedChars, bool caseSensitive=false, char defaultAnswer='\0')
static std::map< EditLine *, EditLineReader * > lineReaders_
Map containing all (EditLine*, EditLineReader*) pairs to make prompt printing possible....