ARB
hotkeys.hxx
Go to the documentation of this file.
1 // ==================================================================== //
2 // //
3 // File : hotkeys.hxx //
4 // Purpose : auto-generated mnemonics for user masks //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in August 2001 //
7 // Copyright Department of Microbiology (Technical University Munich) //
8 // //
9 // Visit our web site at: http://www.arb-home.de/ //
10 // //
11 // ==================================================================== //
12 
13 #ifndef HOTKEYS_HXX
14 #define HOTKEYS_HXX
15 
16 #ifndef _GLIBCXX_STRING
17 #include <string>
18 #endif
19 #ifndef ARBTOOLS_H
20 #include <arbtools.h>
21 #endif
22 
23 // --------------------------
24 // class awt_hotkeys
25 // --------------------------
26 // this class automatically creates hotkeys from strings
27 // use one instance for one set of hotkeys
28 class awt_hotkeys : virtual Noncopyable {
29 private:
30  bool used[26];
31  bool USED[26];
32  char artificial;
33  char current[2];
34 
35 public:
37  for (int i = 0; i<26; ++i) {
38  USED[i] = used[i] = false;
39  }
40  artificial = '0';
41  current[0] = current[1] = 0;
42  }
43  virtual ~awt_hotkeys() {}
44 
45  // return a unique hotkey (returns an empty string if no hotkey left)
46  const char* artificial_hotkey();
47  // return a unique hotkey for label (uses one character from label if possible)
48  const char* hotkey(const std::string& label);
49 };
50 
51 
52 
53 #else
54 #error hotkeys.hxx included twice
55 #endif // HOTKEYS_HXX
56 
return string(buffer, length)
const char * hotkey(const std::string &label)
Definition: hotkeys.cxx:44
virtual ~awt_hotkeys()
Definition: hotkeys.hxx:43
const char * artificial_hotkey()
Definition: hotkeys.cxx:19
const char * label