~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to deprecated/management/profile-editor/src/wxStyledTextCtrl/RESearch.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-08-10 18:12:34 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110810181234-b6obckg60cp99crg
Tags: upstream-2.7.0~beta1+bzr1774
ImportĀ upstreamĀ versionĀ 2.7.0~beta1+bzr1774

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Scintilla source code edit control
2
 
/** @file RESearch.h
3
 
 ** Interface to the regular expression search library.
4
 
 **/
5
 
// Written by Neil Hodgson <neilh@scintilla.org>
6
 
// Based on the work of Ozan S. Yigit.
7
 
// This file is in the public domain.
8
 
 
9
 
#ifndef RESEARCH_H
10
 
#define RESEARCH_H
11
 
 
12
 
/*
13
 
 * The following defines are not meant to be changeable.
14
 
 * They are for readability only.
15
 
 */
16
 
#define MAXCHR  256
17
 
#define CHRBIT  8
18
 
#define BITBLK  MAXCHR/CHRBIT
19
 
 
20
 
class CharacterIndexer {
21
 
public: 
22
 
        virtual char CharAt(int index)=0;
23
 
        virtual ~CharacterIndexer() {
24
 
        }
25
 
};
26
 
 
27
 
class RESearch {
28
 
 
29
 
public:
30
 
        RESearch();
31
 
        ~RESearch();
32
 
        void Init();
33
 
        void Clear();
34
 
        bool GrabMatches(CharacterIndexer &ci);
35
 
        void ChSet(char c);
36
 
        void ChSetWithCase(char c, bool caseSensitive);
37
 
        const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
38
 
        int Execute(CharacterIndexer &ci, int lp, int endp);
39
 
        void ModifyWord(char *s);
40
 
        int Substitute(CharacterIndexer &ci, char *src, char *dst);
41
 
 
42
 
        enum {MAXTAG=10};
43
 
        enum {MAXNFA=2048};
44
 
        enum {NOTFOUND=-1};
45
 
 
46
 
        int bopat[MAXTAG];
47
 
        int eopat[MAXTAG];
48
 
        char *pat[MAXTAG];
49
 
 
50
 
private:
51
 
        int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
52
 
 
53
 
        int bol;
54
 
        int  tagstk[MAXTAG];             /* subpat tag stack..*/
55
 
        char nfa[MAXNFA];               /* automaton..       */
56
 
        int sta;
57
 
        char bittab[BITBLK];            /* bit table for CCL */
58
 
                                                /* pre-set bits...   */
59
 
        int failure;
60
 
};
61
 
 
62
 
#endif