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