regexst.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef REGEXST_H
  20. #define REGEXST_H
  21. #include "unicode/utypes.h"
  22. #include "unicode/utext.h"
  23. #if !UCONFIG_NO_REGULAR_EXPRESSIONS
  24. #include "regeximp.h"
  25. #include "regexcst.h"
  26. U_NAMESPACE_BEGIN
  27. class UnicodeSet;
  28. class RegexStaticSets : public UMemory {
  29. public:
  30. static RegexStaticSets *gStaticSets; // Ptr to all lazily initialized constant
  31. // shared sets.
  32. RegexStaticSets(UErrorCode *status);
  33. ~RegexStaticSets();
  34. static void initGlobals(UErrorCode *status);
  35. UnicodeSet fPropSets[URX_LAST_SET] {}; // The sets for common regex items, e.g. \s
  36. Regex8BitSet fPropSets8[URX_LAST_SET] {}; // Fast bitmap sets for latin-1 range for above.
  37. UnicodeSet fRuleSets[kRuleSet_count] {}; // Sets used while parsing regexp patterns.
  38. UnicodeSet fUnescapeCharSet {}; // Set of chars handled by unescape when
  39. // encountered with a \ in a pattern.
  40. UnicodeSet *fRuleDigitsAlias {};
  41. UText *fEmptyText {}; // An empty string, to be used when a matcher
  42. // is created with no input.
  43. };
  44. U_NAMESPACE_END
  45. #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
  46. #endif // REGEXST_H