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.

71 lines
1.4 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // realm.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class Realms.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 09/08/1998 Original version.
  16. // 03/03/1999 Rewritten to use the VBScript RegExp object.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef REALM_H
  20. #define REALM_H
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. #include <perimeter.h>
  25. #include <regex.h>
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // Realms
  31. //
  32. // DESCRIPTION
  33. //
  34. // Manages a sequence of realm stripping rules.
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. class Realms
  38. {
  39. public:
  40. Realms();
  41. ~Realms() throw ();
  42. HRESULT setRealms(VARIANT* pValue) throw ();
  43. bool empty() const throw ()
  44. { return begin == end; }
  45. HRESULT process(PCWSTR in, BSTR* out) const throw ();
  46. protected:
  47. struct Rule
  48. {
  49. RegularExpression regexp;
  50. BSTR replace;
  51. Rule() throw ();
  52. ~Rule() throw ();
  53. };
  54. void setRules(Rule* rules, ULONG numRules) throw ();
  55. private:
  56. mutable Perimeter monitor;
  57. Rule* begin;
  58. Rule* end;
  59. };
  60. #endif // REALM_H