Leaked source code of windows server 2003
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.

64 lines
1.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class RegularExpression.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef REGEX_H
  11. #define REGEX_H
  12. #pragma once
  13. struct IRegExp2;
  14. class FastCoCreator;
  15. ///////////////////////////////////////////////////////////////////////////////
  16. //
  17. // CLASS
  18. //
  19. // RegularExpression
  20. //
  21. // DESCRIPTION
  22. //
  23. // General-purpose regular expression evaluator.
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. class RegularExpression
  27. {
  28. public:
  29. RegularExpression() throw ();
  30. ~RegularExpression() throw ();
  31. HRESULT setGlobal(BOOL fGlobal) throw ();
  32. HRESULT setIgnoreCase(BOOL fIgnoreCase) throw ();
  33. HRESULT setPattern(PCWSTR pszPattern) throw ();
  34. HRESULT replace(
  35. BSTR sourceString,
  36. BSTR replaceString,
  37. BSTR* pDestString
  38. ) const throw ();
  39. BOOL testBSTR(BSTR sourceString) const throw ();
  40. BOOL testString(PCWSTR sourceString) const throw ();
  41. void swap(RegularExpression& obj) throw ();
  42. protected:
  43. HRESULT checkInit() throw ();
  44. private:
  45. IRegExp2* regex;
  46. // Used for creating RegExp objects.
  47. static FastCoCreator theCreator;
  48. // Not implemented.
  49. RegularExpression(const RegularExpression&);
  50. RegularExpression& operator=(const RegularExpression&);
  51. };
  52. #endif // REGEX_H