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.

103 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name :
  4. linklkup.cpp
  5. Abstract:
  6. Link look up table class implementaions. The is a MFC CMap
  7. constains the previous visited web link. This is used
  8. as a look up table for visited link.
  9. Author:
  10. Michael Cheuk (mcheuk) 22-Nov-1996
  11. Project:
  12. Link Checker
  13. Revision History:
  14. --*/
  15. #include "stdafx.h"
  16. #include "linklkup.h"
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. void
  23. CLinkLookUpTable::Add(
  24. const CString& strKey,
  25. const CLink& link
  26. )
  27. /*++
  28. Routine Description:
  29. Wrapper function for adding item to CMap
  30. Arguments:
  31. strKey - use URL string as map key
  32. link - link object to add
  33. Return Value:
  34. N/A
  35. --*/
  36. {
  37. LinkLookUpItem_t item;
  38. item.LinkState = link.GetState();
  39. item.nStatusCode = link.GetStatusCode();
  40. SetAt(strKey, item);
  41. } // CLinkLookUpTable::Add
  42. BOOL
  43. CLinkLookUpTable::Get(
  44. const CString& strKey,
  45. CLink& link
  46. ) const
  47. /*++
  48. Routine Description:
  49. Wrapper function for getting item from CMap
  50. Arguments:
  51. strKey - us URL string as map key
  52. link - link object to fill in
  53. Return Value:
  54. BOOL - TRUE if found. FALSE otherwise.
  55. --*/
  56. {
  57. LinkLookUpItem_t item;
  58. if(Lookup(strKey, item))
  59. {
  60. // Found the link
  61. link.SetState(item.LinkState);
  62. link.SetStatusCode(item.nStatusCode);
  63. return TRUE;
  64. }
  65. return FALSE;
  66. } // CLinkLookUpTable::Get