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