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.

55 lines
2.3 KiB

  1. // -------------------------------------------------------------------------------
  2. // Addparse.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // -------------------------------------------------------------------------------
  5. #ifndef __ADDPARSE_H
  6. #define __ADDPARSE_H
  7. // -------------------------------------------------------------------------------
  8. // Depends
  9. // -------------------------------------------------------------------------------
  10. #include "strconst.h"
  11. #include "wstrpar.h"
  12. #include "bytebuff.h"
  13. // -------------------------------------------------------------------------------
  14. // CAddressParser
  15. // -------------------------------------------------------------------------------
  16. class CAddressParser
  17. {
  18. public:
  19. // ---------------------------------------------------------------------------
  20. // CAddressParser Methods
  21. // ---------------------------------------------------------------------------
  22. void Init(LPCWSTR pszAddress, ULONG cchAddress);
  23. HRESULT Next(void);
  24. // ---------------------------------------------------------------------------
  25. // Accessors
  26. // ---------------------------------------------------------------------------
  27. LPCWSTR PszFriendly(void);
  28. ULONG CchFriendly(void);
  29. LPCWSTR PszEmail(void);
  30. ULONG CchEmail(void);
  31. private:
  32. // ---------------------------------------------------------------------------
  33. // Private Methods
  34. // ---------------------------------------------------------------------------
  35. HRESULT _HrAppendFriendly(void);
  36. HRESULT _HrAppendUnsure(WCHAR chStart, WCHAR chEnd);
  37. HRESULT _HrIsEmailAddress(WCHAR chStart, WCHAR chEnd, BOOL *pfIsEmail);
  38. HRESULT _HrQuotedEmail(WCHAR *pchToken);
  39. private:
  40. // ---------------------------------------------------------------------------
  41. // Private Data
  42. // ---------------------------------------------------------------------------
  43. CStringParserW m_cString; // String Parser
  44. BYTE m_rgbStatic1[256]; // Static Used for Friendly
  45. BYTE m_rgbStatic2[256]; // Static Used for Email
  46. CByteBuffer m_cFriendly; // Parsed Friendly Name
  47. CByteBuffer m_cEmail; // Email Name
  48. };
  49. #endif // __ADDPARSE_H