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.

125 lines
1.8 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. Author:
  6. */
  7. #ifndef __SDP_EMAIL__
  8. #define __SDP_EMAIL__
  9. #include "sdpcommo.h"
  10. #include "sdpgen.h"
  11. #include "sdpcstrl.h"
  12. #include "sdpbstrl.h"
  13. class _DllDecl SDP_EMAIL : public SDP_VALUE
  14. {
  15. public:
  16. SDP_EMAIL();
  17. virtual void Reset();
  18. inline BSTR CreateBstr();
  19. inline void SetCharacterSet(
  20. IN SDP_CHARACTER_SET CharacterSet
  21. );
  22. protected:
  23. BOOL m_IsTextValid;
  24. SDP_OPTIONAL_BSTRING m_Address;
  25. SDP_BSTRING m_Text;
  26. virtual BOOL GetField(
  27. OUT SDP_FIELD *&Field,
  28. OUT BOOL &AddToArray
  29. );
  30. };
  31. inline BSTR
  32. SDP_EMAIL::CreateBstr(
  33. )
  34. {
  35. // TBD - to be done
  36. return NULL;
  37. }
  38. inline void
  39. SDP_EMAIL::SetCharacterSet(
  40. IN SDP_CHARACTER_SET CharacterSet
  41. )
  42. {
  43. m_Text.SetCharacterSet(CharacterSet);
  44. }
  45. class _DllDecl SDP_EMAIL_LIST: public BSTR_ARRAY
  46. {
  47. public:
  48. inline void SetCharacterSet(
  49. IN SDP_CHARACTER_SET CharacterSet
  50. );
  51. inline BOOL ParseLine(
  52. IN OUT CHAR *&Line
  53. );
  54. protected:
  55. SDP_EMAIL m_Email;
  56. };
  57. inline void
  58. SDP_EMAIL_LIST::SetCharacterSet(
  59. IN SDP_CHARACTER_SET CharacterSet
  60. )
  61. {
  62. m_Email.SetCharacterSet(CharacterSet);
  63. }
  64. inline BOOL
  65. SDP_EMAIL_LIST::ParseLine(
  66. IN OUT CHAR *&Line
  67. )
  68. {
  69. if ( !m_Email.ParseLine(Line) )
  70. {
  71. return FALSE;
  72. }
  73. try
  74. {
  75. Add(m_Email.CreateBstr());
  76. }
  77. catch(...)
  78. {
  79. SetLastError(ERROR_OUTOFMEMORY);
  80. return FALSE;
  81. }
  82. m_Email.Reset();
  83. return TRUE;
  84. }
  85. #endif // __SDP_EMAIL__