Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/shell/shell_completion_plugin.h @ 7374

Last change on this file since 7374 was 7374, checked in by bensch, 18 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
RevLine 
[4838]1/*!
[7374]2 * @file shell_completion_plugin.h
3 * @brief The Shell Completion Plugin
4 */
[1853]5
[7374]6#ifndef _SHELL_COMPLETION_PLUGIN_H
7#define _SHELL_COMPLETION_PLUGIN_H
[1853]8
[7374]9#include <list>
[7373]10#include <vector>
[7225]11#include <string>
[5779]12
[7374]13namespace OrxShell
[7373]14{
[7374]15  class ShellCompletor
16  {
17  public:
18    virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0;
19    virtual ~ShellCompletor() { };
[1853]20
[7374]21  protected:
22    ShellCompletor();
23  };
[7371]24
[7374]25  class ShellCompletorStringArray : public ShellCompletor
[7373]26  {
[7374]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;
[7371]35  };
36
[1853]37
[7374]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  };
[7373]46
[3245]47
[7374]48  //! A class for Completing the an InputString.
49  class ShellCompletionPlugin
50  {
51  public:
52    ShellCompletionPlugin();
[5178]53
54
[7374]55  };
[7371]56
[7374]57}
58#endif /* _SHELL_COMPLETION_PLUGIN_H */
Note: See TracBrowser for help on using the repository browser.