summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-xetex/i18n/regexst.h
blob: 2fd9c32d7730c66ed8d251a6e76170842c03526e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
//  regexst.h
//
//  Copyright (C) 2003-2007, International Business Machines Corporation and others.
//  All Rights Reserved.
//
//  This file contains declarations for the class RegexStaticSets
//
//  This class is internal to the regular expression implementation.
//  For the public Regular Expression API, see the file "unicode/regex.h"
//
//  RegexStaticSets groups together the common UnicodeSets that are needed
//   for compiling or executing RegularExpressions.  This grouping simplifies
//   the thread safe lazy creation and sharing of these sets across
//   all instances of regular expressions.
//

#ifndef REGEXST_H
#define REGEXST_H

#include "unicode/utypes.h"
#if !UCONFIG_NO_REGULAR_EXPRESSIONS

#include "regeximp.h"

U_NAMESPACE_BEGIN

class  UnicodeSet;


class RegexStaticSets : public UMemory {
public:
    static RegexStaticSets *gStaticSets;  // Ptr to all lazily initialized constant
                                          //   shared sets.

    RegexStaticSets(UErrorCode *status);         
    ~RegexStaticSets();
    static void    initGlobals(UErrorCode *status);
    static UBool   cleanup();

    UnicodeSet    *fPropSets[URX_LAST_SET];     // The sets for common regex items, e.g. \s
    Regex8BitSet   fPropSets8[URX_LAST_SET];    // Fast bitmap sets for latin-1 range for above.

    UnicodeSet    *fRuleSets[10];               // Sets used while parsing regexp patterns.
    UnicodeSet    fUnescapeCharSet;            // Set of chars handled by unescape when
                                               //   encountered with a \ in a pattern.
    UnicodeSet    *fRuleDigitsAlias;
    UnicodeString fEmptyString;                // An empty string, to be used when a matcher
                                               //   is created with no input.

};


U_NAMESPACE_END
#endif   // !UCONFIG_NO_REGULAR_EXPRESSIONS
#endif   // REGEXST_H