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.

176 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgdev.hxx
  6. Abstract:
  7. Debug Device interface class. All debug devices
  8. must derive from this class
  9. Author:
  10. Steve Kiraly (SteveKi) 7-Apr-1995
  11. Revision History:
  12. --*/
  13. #ifndef _DBGDEV_HXX_
  14. #define _DBGDEV_HXX_
  15. DEBUG_NS_BEGIN
  16. class TDebugDevice : public TDebugNodeDouble {
  17. public:
  18. enum ECharType
  19. {
  20. kAnsi,
  21. kUnicode,
  22. kUnknown,
  23. };
  24. TDebugDevice::
  25. TDebugDevice(
  26. IN LPCTSTR pszConfiguration,
  27. IN EDebugType eDebugType
  28. );
  29. virtual
  30. TDebugDevice::
  31. ~TDebugDevice(
  32. VOID
  33. );
  34. virtual
  35. BOOL
  36. TDebugDevice::
  37. bValid(
  38. VOID
  39. ) const;
  40. virtual
  41. BOOL
  42. TDebugDevice::
  43. bOutput (
  44. IN UINT uSize,
  45. IN LPBYTE pBuffer
  46. ) = 0;
  47. TDebugDevice::ECharType
  48. TDebugDevice::
  49. eGetCharType(
  50. VOID
  51. ) const;
  52. EDebugType
  53. TDebugDevice::
  54. eGetDebugType(
  55. VOID
  56. ) const;
  57. LPCTSTR
  58. TDebugDevice::
  59. pszGetConfigurationString(
  60. VOID
  61. ) const;
  62. UINT
  63. MapStringTypeToDevice(
  64. IN LPCTSTR pszDeviceString
  65. ) const;
  66. protected:
  67. class TIterator {
  68. public:
  69. TIterator(
  70. IN TDebugDevice *DbgDevice
  71. );
  72. ~TIterator(
  73. VOID
  74. );
  75. BOOL
  76. bValid(
  77. VOID
  78. ) const;
  79. VOID
  80. First(
  81. VOID
  82. );
  83. VOID
  84. Next(
  85. VOID
  86. );
  87. BOOL
  88. IsDone(
  89. VOID
  90. ) const;
  91. LPCTSTR
  92. Current(
  93. VOID
  94. ) const;
  95. UINT
  96. Index(
  97. VOID
  98. ) const;
  99. private:
  100. LPTSTR _pStr;
  101. LPTSTR _pCurrent;
  102. LPTSTR _pEnd;
  103. BOOL _bValid;
  104. UINT _uIndex;
  105. };
  106. friend class TIterator;
  107. private:
  108. struct DeviceMap
  109. {
  110. UINT Id;
  111. LPCTSTR Name;
  112. };
  113. //
  114. // Copying and assignment are not defined.
  115. //
  116. TDebugDevice::
  117. TDebugDevice(
  118. const TDebugDevice &rhs
  119. );
  120. const TDebugDevice &
  121. TDebugDevice::
  122. operator=(
  123. const TDebugDevice &rhs
  124. );
  125. LPTSTR _pszConfiguration;
  126. ECharType _eCharType;
  127. EDebugType _eDebugType;
  128. };
  129. DEBUG_NS_END
  130. #endif