FACT++  1.0
char ** Readline::Completion ( const char *  text,
int  start,
int  end 
)
protectedvirtual

The readline manual says about this function:

A pointer to an alternative function to create matches. The function is called with text, start, and end. start and end are indices in rl_line_buffer saying what the boundaries of text are. If this function exists and returns NULL, or if this variable is set to NULL, then rl_complete() will call the value of rl_completion_entry_function to generate matches, otherwise the array of strings returned will be used.

This function is virtual and can be overwritten. It defaults to a call to rl_completion_matches with CompleteImp as an argument which defaults to filename completion, but can also be overwritten.

It is suggested that you call Complete(const vector<string>&, const char*) from here.

Parameters
textA pointer to a char array conatining the text which should be completed. The text is null-terminated.
startThe start index within readline's line buffer rl_line_buffer, at which the text starts which presumably should be completed.
endThe end index within readline's line buffer rl_line_buffer, at which the text ends which presumably should be completed.
Returns
An array of strings which were allocated with malloc and which will be freed by readline with the possible matches.

Reimplemented in RemoteControl< Console >, RemoteControl< ConsoleStream >, RemoteControl< Shell >, LocalControl< Console >, LocalControl< Shell >, and LocalControl< ConsoleStream >.

Definition at line 541 of file Readline.cc.

References CompleteImp().

Referenced by rl_ncurses_completion_function().

542 {
543  // To do filename completion call
544  return rl_completion_matches((char*)text, CompleteImp);
545 }
static char * CompleteImp(const char *text, int state)
Calls Complete()
Definition: Readline.cc:500

+ Here is the call graph for this function:

+ Here is the caller graph for this function: