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.

88 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name :
  4. linkpars.h
  5. Abstract:
  6. Link parser class declaration. This class responsible for
  7. parsing the html file for hyperlink.
  8. Author:
  9. Michael Cheuk (mcheuk)
  10. Project:
  11. Link Checker
  12. Revision History:
  13. --*/
  14. #ifndef _LINKPARS_H_
  15. #define _LINKPARS_H_
  16. #include "link.h"
  17. //---------------------------------------------------------------------------
  18. // Link parser
  19. //
  20. class CLinkParser
  21. {
  22. // Public interfaces
  23. public:
  24. // Constructor
  25. CLinkParser() :
  26. m_strLocalHostName(_T("localhost")) {}
  27. // Parse a page of html data
  28. void Parse(
  29. const CString& strData,
  30. const CString& strBaseUrl,
  31. CLinkPtrList& rLinkPtrList
  32. );
  33. // Setup the local hostname. It will be uses for distinguishing
  34. // between local and remote link
  35. void SetLocalHostName(
  36. const CString& strLocalHostName
  37. )
  38. {
  39. m_strLocalHostName = strLocalHostName;
  40. }
  41. // Protected interfaces
  42. protected:
  43. // Parse a single "<.....>" for possible hyperlink
  44. BOOL ParsePossibleTag(
  45. CString& strTag
  46. );
  47. // Get the hyperlink value from "<.....>"
  48. BOOL GetTagValue(
  49. CString& strTag,
  50. const CString& strParam);
  51. // Create a URL from base URL & relative URL. It also check the
  52. // result for local & remote link
  53. BOOL CreateURL(
  54. const CString& strRelativeURL,
  55. const CString& strBaseURL,
  56. CString& strURL,
  57. BOOL& fLocalLink);
  58. // Protected members
  59. protected:
  60. CString m_strLocalHostName; // local hostname
  61. }; // class CLinkParser
  62. #endif // _LINKPARS_H_