Last change
on this file since 7685 was
7374,
checked in by bensch, 19 years ago
|
orxonox/trunk: added new Files shell_completion_plugin for the new Plugin Structure.
Also created the first namespace: OrxShell
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file shell_completion_plugin.h |
---|
3 | * @brief The Shell Completion Plugin |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _SHELL_COMPLETION_PLUGIN_H |
---|
7 | #define _SHELL_COMPLETION_PLUGIN_H |
---|
8 | |
---|
9 | #include <list> |
---|
10 | #include <vector> |
---|
11 | #include <string> |
---|
12 | |
---|
13 | namespace OrxShell |
---|
14 | { |
---|
15 | class ShellCompletor |
---|
16 | { |
---|
17 | public: |
---|
18 | virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0; |
---|
19 | virtual ~ShellCompletor() { }; |
---|
20 | |
---|
21 | protected: |
---|
22 | ShellCompletor(); |
---|
23 | }; |
---|
24 | |
---|
25 | class ShellCompletorStringArray : public ShellCompletor |
---|
26 | { |
---|
27 | public: |
---|
28 | ShellCompletorStringArray(const std::string* stringArray, unsigned int size) |
---|
29 | : _stringArray(stringArray), _size(size) {}; |
---|
30 | virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin); |
---|
31 | |
---|
32 | private: |
---|
33 | const std::string* _stringArray; |
---|
34 | unsigned int _size; |
---|
35 | }; |
---|
36 | |
---|
37 | |
---|
38 | //! A Templated Completor |
---|
39 | template<typename CLASS> class ShellCompletorTList : public ShellCompletor |
---|
40 | { |
---|
41 | public: |
---|
42 | ShellCompletorTList(const std::list<CLASS*>& completionList); |
---|
43 | virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) |
---|
44 | {}; |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | //! A class for Completing the an InputString. |
---|
49 | class ShellCompletionPlugin |
---|
50 | { |
---|
51 | public: |
---|
52 | ShellCompletionPlugin(); |
---|
53 | |
---|
54 | |
---|
55 | }; |
---|
56 | |
---|
57 | } |
---|
58 | #endif /* _SHELL_COMPLETION_PLUGIN_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.