Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | // |
michael@0 | 2 | // regexst.h |
michael@0 | 3 | // |
michael@0 | 4 | // Copyright (C) 2003-2010, International Business Machines Corporation and others. |
michael@0 | 5 | // All Rights Reserved. |
michael@0 | 6 | // |
michael@0 | 7 | // This file contains declarations for the class RegexStaticSets |
michael@0 | 8 | // |
michael@0 | 9 | // This class is internal to the regular expression implementation. |
michael@0 | 10 | // For the public Regular Expression API, see the file "unicode/regex.h" |
michael@0 | 11 | // |
michael@0 | 12 | // RegexStaticSets groups together the common UnicodeSets that are needed |
michael@0 | 13 | // for compiling or executing RegularExpressions. This grouping simplifies |
michael@0 | 14 | // the thread safe lazy creation and sharing of these sets across |
michael@0 | 15 | // all instances of regular expressions. |
michael@0 | 16 | // |
michael@0 | 17 | |
michael@0 | 18 | #ifndef REGEXST_H |
michael@0 | 19 | #define REGEXST_H |
michael@0 | 20 | |
michael@0 | 21 | #include "unicode/utypes.h" |
michael@0 | 22 | #include "unicode/utext.h" |
michael@0 | 23 | #if !UCONFIG_NO_REGULAR_EXPRESSIONS |
michael@0 | 24 | |
michael@0 | 25 | #include "regeximp.h" |
michael@0 | 26 | |
michael@0 | 27 | U_NAMESPACE_BEGIN |
michael@0 | 28 | |
michael@0 | 29 | class UnicodeSet; |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | class RegexStaticSets : public UMemory { |
michael@0 | 33 | public: |
michael@0 | 34 | static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant |
michael@0 | 35 | // shared sets. |
michael@0 | 36 | |
michael@0 | 37 | RegexStaticSets(UErrorCode *status); |
michael@0 | 38 | ~RegexStaticSets(); |
michael@0 | 39 | static void initGlobals(UErrorCode *status); |
michael@0 | 40 | static UBool cleanup(); |
michael@0 | 41 | |
michael@0 | 42 | UnicodeSet *fPropSets[URX_LAST_SET]; // The sets for common regex items, e.g. \s |
michael@0 | 43 | Regex8BitSet fPropSets8[URX_LAST_SET]; // Fast bitmap sets for latin-1 range for above. |
michael@0 | 44 | |
michael@0 | 45 | UnicodeSet fRuleSets[10]; // Sets used while parsing regexp patterns. |
michael@0 | 46 | UnicodeSet fUnescapeCharSet; // Set of chars handled by unescape when |
michael@0 | 47 | // encountered with a \ in a pattern. |
michael@0 | 48 | UnicodeSet *fRuleDigitsAlias; |
michael@0 | 49 | UText *fEmptyText; // An empty string, to be used when a matcher |
michael@0 | 50 | // is created with no input. |
michael@0 | 51 | |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | |
michael@0 | 55 | U_NAMESPACE_END |
michael@0 | 56 | #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS |
michael@0 | 57 | #endif // REGEXST_H |
michael@0 | 58 |