blob: bcb393dd3f3c226e17e7fe7389b7bb87b4b71103 [file] [log] [blame]
Victor Chang73229502020-09-17 13:39:19 +01001// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3//
4// regexst.h
5//
6// Copyright (C) 2003-2010, International Business Machines Corporation and others.
7// All Rights Reserved.
8//
9// This file contains declarations for the class RegexStaticSets
10//
11// This class is internal to the regular expression implementation.
12// For the public Regular Expression API, see the file "unicode/regex.h"
13//
14// RegexStaticSets groups together the common UnicodeSets that are needed
15// for compiling or executing RegularExpressions. This grouping simplifies
16// the thread safe lazy creation and sharing of these sets across
17// all instances of regular expressions.
18//
19
20#ifndef REGEXST_H
21#define REGEXST_H
22
23#include "unicode/utypes.h"
24#include "unicode/utext.h"
25#if !UCONFIG_NO_REGULAR_EXPRESSIONS
26
27#include "regeximp.h"
Victor Changd8aa9d52021-01-05 23:49:57 +000028#include "regexcst.h"
Victor Chang73229502020-09-17 13:39:19 +010029
30U_NAMESPACE_BEGIN
31
32class UnicodeSet;
33
34
35class RegexStaticSets : public UMemory {
36public:
37 static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant
38 // shared sets.
39
40 RegexStaticSets(UErrorCode *status);
41 ~RegexStaticSets();
42 static void initGlobals(UErrorCode *status);
Victor Chang73229502020-09-17 13:39:19 +010043
Victor Changd8aa9d52021-01-05 23:49:57 +000044 UnicodeSet fPropSets[URX_LAST_SET] {}; // The sets for common regex items, e.g. \s
45 Regex8BitSet fPropSets8[URX_LAST_SET] {}; // Fast bitmap sets for latin-1 range for above.
Victor Chang73229502020-09-17 13:39:19 +010046
Victor Changd8aa9d52021-01-05 23:49:57 +000047 UnicodeSet fRuleSets[kRuleSet_count] {}; // Sets used while parsing regexp patterns.
48 UnicodeSet fUnescapeCharSet {}; // Set of chars handled by unescape when
49 // encountered with a \ in a pattern.
50 UnicodeSet *fRuleDigitsAlias {};
51 UText *fEmptyText {}; // An empty string, to be used when a matcher
52 // is created with no input.
Victor Chang73229502020-09-17 13:39:19 +010053
54};
55
56
57U_NAMESPACE_END
58#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
59#endif // REGEXST_H
60