44 static char *
CompleteImp(
const char* text,
int state);
51 virtual int Getc(FILE *);
53 virtual void EventHook(
bool newline=
false);
54 virtual void Shutdown(
const char *buf);
59 virtual char *
Complete(
const char* text,
int state);
64 void SetCompletion(
const std::vector<std::string> *v) { fCompletion = v; }
65 char **
Complete(
const std::vector<std::string> &v,
const char *text);
100 virtual bool PreProcess(
const std::string &str);
101 virtual bool Process(
const std::string &str);
103 virtual bool PromptEOF(std::string &str);
104 virtual std::string
Prompt(
const std::string &prompt);
105 virtual void Run(
const char *prompt=0);
108 int Execute(
const std::string &fname,
const std::map<std::string,std::string> &args=std::map<std::string,std::string>());
125 static char *
Compare(
const std::string &str,
const std::string &txt);
126 static char **
CompletionMatches(
const char *text,
char *(*func)(
const char*,
int));
142 static void Resize(
int w,
int h);
149 static std::string
StaticPrompt(
const std::string &prompt);
static char * Compare(const std::string &str, const std::string &txt)
void UpdatePrompt() const
virtual void Redisplay()
Default: call rl_redisplay()
static std::string StaticPrompt(const std::string &prompt)
static char * CompleteImp(const char *text, int state)
Calls Complete()
const std::vector< std::string > * fCompletion
Pointer to a list of possible matched for auto-completion.
void SetCompletion(const std::vector< std::string > *v)
static int rl_ncurses_event_hook()
virtual bool PrintCommands()
static int GetLineLength()
return the length of the prompt plus the length of the line buffer
static bool DumpHistory()
static int GetScriptDepth()
int GetRows() const
Get the number of rows readline assumes the screen size to be.
static int GetBufferLength()
static bool RedirectionWrapper(std::ostream &out, bool(*function)())
virtual bool Process(const std::string &str)
Readline(const char *prgname)
std::ofstream fCommandLog
Maximum number of lines in the history file.
void BindKeySequence(const char *seq, int(*func)(int, int))
int fMaxLines
Filename for the history file compiled in the constructor.
virtual std::string GetUpdatePrompt() const
static char ** CompletionMatches(const char *text, char *(*func)(const char *, int))
virtual void PrintReadlineError(const std::string &str)
static int rl_ncurses_startup()
virtual void SetSection(int)
static void StaticPopHistory(const std::string &fname)
std::vector< const char * > GetHistory() const
Return a list of pointer to the history contents.
virtual std::string Prompt(const std::string &prompt)
virtual bool ExecuteShellCommand(const std::string &cmd)
virtual void Shutdown(const char *buf)
static std::string GetBuffer()
static void StaticPushHistory(const std::string &fname)
virtual void Run(const char *prompt=0)
static bool DumpFunctions()
static bool IsScriptStopped()
static std::string fExternalInput
static void SetScriptDepth(unsigned int d)
static std::string GetPrompt()
int Execute(const std::string &fname, const std::map< std::string, std::string > &args=std::map< std::string, std::string >())
int GetCols() const
Get the number of cols readline assumes the screen size to be.
static char ** rl_ncurses_completion_function(const char *text, int start, int end)
virtual void Startup()
Default: Do nothing.
static void SetExternalInput(const std::string &inp)
static void rl_ncurses_completion_display(char **matches, int num, int max)
static int GetAbsCursor()
return strlen(rl_display_prompt) + rl_point
static std::string GetExternalInput()
virtual void CompletionDisplay(char **matches, int num, int max)
Default: call rl_completion_display_matches()
virtual char ** Completion(const char *text, int start, int end)
static int rl_ncurses_getc(FILE *)
Static member function which are used to adapt readline to ncurses.
static std::string fScript
virtual char * Complete(const char *text, int state)
Functions dealing with auto completion.
static Readline * Instance()
virtual bool PromptEOF(std::string &str)
static bool ClearHistory()
void ProcessLine(const std::string &str)
int fLine
Last line adde to history.
virtual int Getc(FILE *)
The non static implementations of the callback funtions above.
static int GetCursor()
return rl_point (the current cursor position within the line buffer)
std::string GetName() const
static FILE * SetStreamIn(FILE *f)
virtual bool PreProcess(const std::string &str)
virtual void EventHook(bool newline=false)
void SetMaxSize(int lines)
C++ wrapper for GNU's readline library.
static std::string GetScript()
void AddToHistory(const std::string &str, int skip=2)
static bool DumpVariables()
static void rl_ncurses_redisplay()
virtual std::string GetLinePrompt() const
virtual bool PrintGeneralHelp()
static FILE * SetStreamOut(FILE *f)
virtual bool PrintKeyBindings()