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.

112 lines
2.0 KiB

  1. // CSpec.h -- Card Specification
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1998. 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. #if !defined(SLBCSP_CSPEC_H)
  8. #define SLBCSP_CSPEC_H
  9. #include <string>
  10. #include <windows.h>
  11. class CSpec
  12. {
  13. std::string m_sReader;
  14. std::string m_sCardId;
  15. std::string m_sSpec;
  16. char const &BreakToken(void) const
  17. {
  18. static char const cBreakToken('\\');
  19. return cBreakToken;
  20. }
  21. std::string const &
  22. DeviceIdToken(void)
  23. {
  24. static std::string const sDeviceId("\\\\.\\");
  25. return sDeviceId;
  26. }
  27. void
  28. SetSpec(void);
  29. bool
  30. ValidName(std::string const &rsName) const;
  31. public:
  32. CSpec(std::string const &rsSpec);
  33. CSpec(std::string const &rsReader,
  34. std::string const &rsCardId);
  35. CSpec(CSpec const &rhs);
  36. CSpec() {};
  37. virtual
  38. ~CSpec() {};
  39. virtual void
  40. Empty(void);
  41. void
  42. EmptyCardId(void);
  43. void
  44. EmptyReader(void);
  45. static bool
  46. Equiv(std::string const &rsSpec,
  47. std::string const &rsName);
  48. virtual bool
  49. Equiv(CSpec const &rhs) const;
  50. virtual bool
  51. IsEmpty(void) const
  52. {
  53. return m_sSpec.empty() == true;
  54. }
  55. std::string const &
  56. Reader(void) const
  57. {
  58. return m_sReader;
  59. }
  60. std::string const &
  61. CardId(void) const
  62. {
  63. return m_sCardId;
  64. }
  65. virtual void
  66. RefreshSpec(void);
  67. void
  68. SetCardId(std::string const &rcsCardId);
  69. void
  70. SetReader(std::string const &rcsReader);
  71. virtual std::string const &
  72. Spec(void) const
  73. {
  74. return m_sSpec;
  75. }
  76. virtual CSpec &
  77. operator=(CSpec const &rhs);
  78. operator std::string const &()
  79. {
  80. return Spec();
  81. }
  82. };
  83. #endif // SLBCSP_CSPEC_H