]> Creatis software - cpPlugins.git/blob - lib/TinyCon/CompletionConsole.h
Moved to version 1.0
[cpPlugins.git] / lib / TinyCon / CompletionConsole.h
1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4 #ifndef __TinyCon__CompletionConsole__h__
5 #define __TinyCon__CompletionConsole__h__
6
7 #include <TinyCon/Console.h>
8 #include <TinyCon/Trie.h>
9
10 namespace TinyCon
11 {
12   /**
13    */
14   class CPPLUGINS_TINYCON_EXPORT CompletionConsole
15     : public TinyCon::Console
16   {
17   public:
18     typedef CompletionConsole Self;
19     typedef TinyCon::Console  Superclass;
20
21     typedef TinyCon::Trie TTrie;
22
23   public:
24     CompletionConsole( );
25     CompletionConsole( const std::string& prompt );
26     virtual ~CompletionConsole( );
27
28     TTrie* addCommand( const std::string& cmd );
29     TTrie* addCommand( const std::string& cmd, const std::string& opt );
30     TTrie* addCommand( const std::string& cmd, Trie* opt );
31
32     virtual int trigger( const std::vector< std::string >& args ) = 0;
33     virtual int trigger( const std::string& s ) override;
34     virtual int hotkeys( char c ) override;
35
36   protected:
37     std::string _prefix( const std::vector< std::string >& v ) const;
38
39   protected:
40     TTrie m_CommandsTrie;
41   };
42
43 } // end namespace
44
45 #endif // __TinyCon__CompletionConsole__h__
46
47 // eof - $RCSfile$