Source code of Windows XP (NT5)
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.

135 lines
3.6 KiB

  1. // AdptvCntr.cpp -- ADaPTiVe CoNTaineR class implementation
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #include "stdafx.h"
  8. #include "NoWarning.h"
  9. #include "ForceLib.h"
  10. #include <vector>
  11. #include <algorithm>
  12. #include <functional>
  13. #include <scuOsExc.h>
  14. #include <cciPriKey.h>
  15. #include "RsaKey.h"
  16. #include "CSpec.h"
  17. #include "Container.h"
  18. #include "Secured.h"
  19. #include "CntrFinder.h"
  20. #include <scarderr.h>
  21. using namespace std;
  22. using namespace cci;
  23. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  24. /////////////////////////// PUBLIC /////////////////////////////////
  25. // Types
  26. // C'tors/D'tors
  27. HContainer::HContainer(Container *pcntr)
  28. : slbRefCnt::RCPtr<Container>(pcntr)
  29. {}
  30. // Types
  31. // C'tors/D'tors
  32. Container::~Container()
  33. {}
  34. HContainer
  35. Container::MakeContainer(CSpec const & rcspec,
  36. cci::CContainer const &rccntr)
  37. {
  38. Container *pcntr = new Container(rcspec, rccntr);
  39. return HContainer(pcntr);
  40. }
  41. // Operators
  42. // Operations
  43. void
  44. Container::ClearCache()
  45. {
  46. m_hcntr = 0;
  47. }
  48. // Access
  49. cci::CContainer
  50. Container::TheCContainer() const
  51. {
  52. if (!m_hcntr)
  53. {
  54. throw scu::OsException(NTE_BAD_KEYSET);
  55. }
  56. return m_hcntr;
  57. }
  58. HContainer
  59. Container::Find(CSpec const &rKey)
  60. {
  61. //Work in a silent mode...
  62. CString sEmptyTitle;
  63. ContainerFinder CntrFinder(CardFinder::DialogDisplayMode::ddmNever,
  64. 0,//a window handle
  65. sEmptyTitle);
  66. return CntrFinder.Find(rKey);
  67. }
  68. CSpec const &
  69. Container::TheCSpec() const
  70. {
  71. return m_cspec;
  72. }
  73. // Predicates
  74. // Static Variables
  75. /////////////////////////// PROTECTED /////////////////////////////////
  76. // C'tors/D'tors
  77. Container::Container()
  78. : RCObject(),
  79. CachingObject(),
  80. m_hcntr(),
  81. m_cspec()
  82. {}
  83. // Operators
  84. // Operations
  85. // Access
  86. // Predicates
  87. // Static Variables
  88. /////////////////////////// PRIVATE /////////////////////////////////
  89. // C'tors/D'tors
  90. // Operators
  91. // Operations
  92. Container::Container(CSpec const &rKey)
  93. : RCObject(),
  94. CachingObject(),
  95. m_hcntr(),
  96. m_cspec(rKey)
  97. {}
  98. Container::Container(CSpec const &rKey,
  99. cci::CContainer const &rccard)
  100. : RCObject(),
  101. CachingObject(),
  102. m_hcntr(rccard),
  103. m_cspec(rKey)
  104. {}
  105. // Access
  106. // Predicates
  107. // Static Variables