Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // regex.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Defines the class RegularExpression.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 03/10/1999 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef REGEX_H
  19. #define REGEX_H
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. struct IRegExp;
  24. class FastCoCreator;
  25. ///////////////////////////////////////////////////////////////////////////////
  26. //
  27. // CLASS
  28. //
  29. // RegularExpression
  30. //
  31. // DESCRIPTION
  32. //
  33. // General-purpose regular expression evaluator.
  34. //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. class RegularExpression
  37. {
  38. public:
  39. RegularExpression() throw ();
  40. ~RegularExpression() throw ();
  41. HRESULT setGlobal(BOOL fGlobal) throw ();
  42. HRESULT setIgnoreCase(BOOL fIgnoreCase) throw ();
  43. HRESULT setPattern(PCWSTR pszPattern) throw ();
  44. HRESULT replace(
  45. BSTR sourceString,
  46. BSTR replaceString,
  47. BSTR* pDestString
  48. ) const throw ();
  49. BOOL testBSTR(BSTR sourceString) const throw ();
  50. BOOL testString(PCWSTR sourceString) const throw ();
  51. void swap(RegularExpression& obj) throw ();
  52. protected:
  53. HRESULT checkInit() throw ();
  54. HRESULT setBooleanProperty(
  55. DISPID dispId,
  56. BOOL newVal
  57. ) throw ();
  58. private:
  59. IRegExp* regex;
  60. // Used for creating RegExp objects.
  61. static FastCoCreator theCreator;
  62. // Not implemented.
  63. RegularExpression(const RegularExpression&);
  64. RegularExpression& operator=(const RegularExpression&);
  65. };
  66. #endif // REGEX_H