1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/regexst.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +// 1.5 +// regexst.h 1.6 +// 1.7 +// Copyright (C) 2003-2010, International Business Machines Corporation and others. 1.8 +// All Rights Reserved. 1.9 +// 1.10 +// This file contains declarations for the class RegexStaticSets 1.11 +// 1.12 +// This class is internal to the regular expression implementation. 1.13 +// For the public Regular Expression API, see the file "unicode/regex.h" 1.14 +// 1.15 +// RegexStaticSets groups together the common UnicodeSets that are needed 1.16 +// for compiling or executing RegularExpressions. This grouping simplifies 1.17 +// the thread safe lazy creation and sharing of these sets across 1.18 +// all instances of regular expressions. 1.19 +// 1.20 + 1.21 +#ifndef REGEXST_H 1.22 +#define REGEXST_H 1.23 + 1.24 +#include "unicode/utypes.h" 1.25 +#include "unicode/utext.h" 1.26 +#if !UCONFIG_NO_REGULAR_EXPRESSIONS 1.27 + 1.28 +#include "regeximp.h" 1.29 + 1.30 +U_NAMESPACE_BEGIN 1.31 + 1.32 +class UnicodeSet; 1.33 + 1.34 + 1.35 +class RegexStaticSets : public UMemory { 1.36 +public: 1.37 + static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant 1.38 + // shared sets. 1.39 + 1.40 + RegexStaticSets(UErrorCode *status); 1.41 + ~RegexStaticSets(); 1.42 + static void initGlobals(UErrorCode *status); 1.43 + static UBool cleanup(); 1.44 + 1.45 + UnicodeSet *fPropSets[URX_LAST_SET]; // The sets for common regex items, e.g. \s 1.46 + Regex8BitSet fPropSets8[URX_LAST_SET]; // Fast bitmap sets for latin-1 range for above. 1.47 + 1.48 + UnicodeSet fRuleSets[10]; // Sets used while parsing regexp patterns. 1.49 + UnicodeSet fUnescapeCharSet; // Set of chars handled by unescape when 1.50 + // encountered with a \ in a pattern. 1.51 + UnicodeSet *fRuleDigitsAlias; 1.52 + UText *fEmptyText; // An empty string, to be used when a matcher 1.53 + // is created with no input. 1.54 + 1.55 +}; 1.56 + 1.57 + 1.58 +U_NAMESPACE_END 1.59 +#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS 1.60 +#endif // REGEXST_H 1.61 +