libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
stringmatcher.h
1 /* Copyright (C) 2011 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef T3_WIDGET_STRINGMATCHER_H
15 #define T3_WIDGET_STRINGMATCHER_H
16 
17 #include <string>
18 #include <t3widget/widget_api.h>
19 #include <t3widget/util.h>
20 
21 namespace t3_widget {
22 
23 class T3_WIDGET_LOCAL string_matcher_t {
24  private:
25  cleanup_free_ptr<char>::t needle;
26  size_t needle_size;
27  cleanup_ptr<int[]>::t partial_match_table, reverse_partial_match_table, index_table;
28  int i;
29  void init(void);
30 
31  public:
32  string_matcher_t(const std::string &_needle);
33  string_matcher_t(char *_needle, size_t _needle_size);
34  virtual ~string_matcher_t(void);
35  void reset(void);
36  int next_char(const std::string *c);
37  int previous_char(const std::string *c);
38  int next_char(const char *c, size_t c_size);
39  int previous_char(const char *c, size_t c_size);
40 };
41 
42 }; // namespace
43 #endif
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget li...
Definition: autocompleter.cc:18
Definition: stringmatcher.h:23
complex_error_t init(const init_parameters_t *params)
Initialize the libt3widget library.
Definition: main.cc:254