• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 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"
28 
29 U_NAMESPACE_BEGIN
30 
31 class  UnicodeSet;
32 
33 
34 class RegexStaticSets : public UMemory {
35 public:
36     static RegexStaticSets *gStaticSets;  // Ptr to all lazily initialized constant
37                                           //   shared sets.
38 
39     RegexStaticSets(UErrorCode *status);
40     ~RegexStaticSets();
41     static void    initGlobals(UErrorCode *status);
42     static UBool   cleanup();
43 
44     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.
46 
47     UnicodeSet    fRuleSets[10];               // 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.
53 
54 };
55 
56 
57 U_NAMESPACE_END
58 #endif   // !UCONFIG_NO_REGULAR_EXPRESSIONS
59 #endif   // REGEXST_H
60 
61