Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/shell/shell_completion.h @ 5187

Last change on this file since 5187 was 5187, checked in by bensch, 19 years ago

orxonox/trunk: some restructure of the Completion. now one can supply a Type to each completion

File size: 1.7 KB
Line 
1/*!
2 * @file shell_completion.h
3 * @brief The Shell Completion Tasks
4*/
5
6#ifndef _SHELL_COMPLETION_H
7#define _SHELL_COMPLETION_H
8
9// FORWARD DECLARATION
10class BaseObject;
11class ShellInput;
12template<class T> class tList;
13#ifndef NULL
14#define NULL 0            //!< a pointer to NULL
15#endif
16
17typedef enum {
18  SHELLC_CLASS,
19  SHELLC_OBJECT,
20  SHELLC_FUNCTION,
21  SHELLC_ALIAS,
22} SHELL_CTYPE;
23
24struct ShellC_Element{
25  const char*     name;     //!<
26  SHELL_CTYPE     type;
27};
28
29//! A class for ...
30class ShellCompletion {
31
32 public:
33  ShellCompletion(ShellInput* input = NULL);
34  virtual ~ShellCompletion();
35
36  bool autoComplete(ShellInput* input = NULL);
37  bool classComplete(const char* classBegin);
38  long classMatch(const char* input, unsigned int* length);
39  bool objectComplete(const char* objectBegin, long classID);
40  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
41  bool functionComplete(const char* functionBegin);
42  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
43
44  bool generalComplete(const tList<ShellC_Element>* stringList, const char* begin, const char* displayAs = "%s", const char* addBack = NULL, const char* addFront = NULL);
45
46  const tList<ShellC_Element>* addToCompleteList(const tList<const char>* inputList, const char* completionBegin);
47  const tList<ShellC_Element>* addToCompleteList(const tList<BaseObject>* inputList, const char* completionBegin);
48  void emptyCompletionList();
49//    const tList<const char>* createCompleteList(const tList<ShellCommandBase>* inputList, const char* completionBegin);
50
51
52 private:
53   tList<ShellC_Element>*   completionList;          //!< A list of completions, that are io.
54   ShellInput*              input;
55};
56
57#endif /* _SHELL_COMPLETION_H */
Note: See TracBrowser for help on using the repository browser.