Go to the documentation of this file.
50 saveHistoryToFile_(
false), historyFile_(NULL),
51 historyFilename_(
"commandhistory.txt"), iStream_(iStream),
80 std::string question,
char defaultAnswer,
char yesChar,
char noChar) {
82 string method =
"LineReader::confirmation()";
83 string message =
"LineReader not initialized.";
87 string allowed = string(1, yesChar) + string(1, noChar);
88 char answer =
charQuestion(question, allowed,
false, defaultAnswer);
90 return (answer == yesChar);
198 debugLog(
"Could not open history file for writing.");
std::deque< std::string > inputHistory_
The input history.
void putInInputHistory(const std::string &inputLine)
virtual void setInputHistoryLog(const std::string &historyFilename)
bool saveHistoryToFile_
Should the history be appended in a file?
virtual char charQuestion(std::string question, std::string allowedChars, bool caseSensitive=false, char defaultAnswer='\0')=0
std::string historyFilename_
The filename to write the command history to.
std::size_t inputHistorySize_
The maximum size for input history.
virtual std::size_t inputsInHistory() const
virtual void setSaveInputHistoryToFile(bool flag)
std::ostream & oStream_
The output stream.
LineReader(std::istream &iStream=std::cin, std::ostream &oStream=std::cout)
virtual std::string inputHistoryEntry(std::size_t age) const
virtual void setInputHistoryLength(std::size_t length)
bool initialized_
Flag indicating whether LineReader is initialized.
virtual std::ostream & outputStream()
find Finds info of the inner loops in the false
bool confirmation(std::string question, char defaultAnswer='n', char yesChar='y', char noChar='n')
std::ofstream * historyFile_
The output stream to write the command history to.
#define DEFAULT_INPUT_HISTORY_SIZE