2003-05-02 21:35:01 +00:00
|
|
|
//
|
|
|
|
// regexst.h
|
|
|
|
//
|
2007-06-22 01:06:31 +00:00
|
|
|
// Copyright (C) 2003-2007, International Business Machines Corporation and others.
|
2003-05-02 21:35:01 +00:00
|
|
|
// All Rights Reserved.
|
|
|
|
//
|
|
|
|
// This file contains declarations for the class RegexStaticSets
|
|
|
|
//
|
|
|
|
// This class is internal to the regular expression implementation.
|
|
|
|
// For the public Regular Expression API, see the file "unicode/regex.h"
|
|
|
|
//
|
|
|
|
// RegexStaticSets groups together the common UnicodeSets that are needed
|
|
|
|
// for compiling or executing RegularExpressions. This grouping simplifies
|
|
|
|
// the thread safe lazy creation and sharing of these sets across
|
|
|
|
// all instances of regular expressions.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef REGEXST_H
|
|
|
|
#define REGEXST_H
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
|
|
|
|
|
|
|
|
#include "regeximp.h"
|
|
|
|
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class UnicodeSet;
|
|
|
|
|
|
|
|
|
2003-05-28 03:04:04 +00:00
|
|
|
class RegexStaticSets : public UMemory {
|
2003-05-02 21:35:01 +00:00
|
|
|
public:
|
2003-05-28 01:42:29 +00:00
|
|
|
static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant
|
|
|
|
// shared sets.
|
|
|
|
|
2003-05-02 21:35:01 +00:00
|
|
|
RegexStaticSets(UErrorCode *status);
|
|
|
|
~RegexStaticSets();
|
2003-05-28 01:42:29 +00:00
|
|
|
static void initGlobals(UErrorCode *status);
|
2004-09-12 23:07:29 +00:00
|
|
|
static UBool cleanup();
|
2003-05-02 21:35:01 +00:00
|
|
|
|
2003-05-22 00:44:00 +00:00
|
|
|
UnicodeSet *fPropSets[URX_LAST_SET]; // The sets for common regex items, e.g. \s
|
|
|
|
Regex8BitSet fPropSets8[URX_LAST_SET]; // Fast bitmap sets for latin-1 range for above.
|
2003-05-02 21:35:01 +00:00
|
|
|
|
2003-05-22 00:44:00 +00:00
|
|
|
UnicodeSet *fRuleSets[10]; // Sets used while parsing regexp patterns.
|
2007-06-22 01:06:31 +00:00
|
|
|
UnicodeSet fUnescapeCharSet; // Set of chars handled by unescape when
|
|
|
|
// encountered with a \ in a pattern.
|
|
|
|
UnicodeSet *fRuleDigitsAlias;
|
|
|
|
UnicodeString fEmptyString; // An empty string, to be used when a matcher
|
|
|
|
// is created with no input.
|
2003-05-22 00:44:00 +00:00
|
|
|
|
2003-05-02 21:35:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
U_NAMESPACE_END
|
|
|
|
#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
|
|
|
|
#endif // REGEXST_H
|
2007-06-22 01:06:31 +00:00
|
|
|
|