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.

151 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgstr.cxx
  6. Abstract:
  7. Debug string class header
  8. Author:
  9. Steve Kiraly (SteveKi) 23-May-1998
  10. Revision History:
  11. --*/
  12. #ifndef _DBGSTR_HXX_
  13. #define _DBGSTR_HXX_
  14. DEBUG_NS_BEGIN
  15. class TDebugString
  16. {
  17. public:
  18. TDebugString::
  19. TDebugString(
  20. VOID
  21. );
  22. explicit
  23. TDebugString::
  24. TDebugString(
  25. IN LPCTSTR psz
  26. );
  27. TDebugString::
  28. ~TDebugString(
  29. VOID
  30. );
  31. BOOL
  32. TDebugString::
  33. bEmpty(
  34. VOID
  35. ) const;
  36. BOOL
  37. TDebugString::
  38. bValid(
  39. VOID
  40. ) const;
  41. UINT
  42. TDebugString::
  43. uLen(
  44. VOID
  45. ) const;
  46. BOOL
  47. TDebugString::
  48. bUpdate(
  49. IN LPCTSTR pszNew
  50. );
  51. BOOL
  52. TDebugString::
  53. bCat(
  54. IN LPCTSTR psz
  55. );
  56. operator LPCTSTR(
  57. VOID
  58. ) const;
  59. BOOL
  60. TDebugString::
  61. bFormat(
  62. IN LPCTSTR pszFmt,
  63. IN ...
  64. );
  65. BOOL
  66. TDebugString::
  67. bvFormat(
  68. IN LPCTSTR pszFmt,
  69. IN va_list avlist
  70. );
  71. private:
  72. enum EStringStatus
  73. {
  74. kValid,
  75. kInValid,
  76. };
  77. enum EStringConstants
  78. {
  79. kMaxFormatStringLength = 1024*100
  80. };
  81. //
  82. // Assignment operators are not defined. Clients are forced
  83. // to bUpdate to assinged strings. By doing this the clients
  84. // are forced to call a function that returns a value. The
  85. // issue the assignment operators is they do not return values
  86. // and an assignment may fail due to lack of memory, etc.
  87. //
  88. TDebugString&
  89. TDebugString::
  90. operator=(
  91. IN LPCTSTR psz
  92. );
  93. TDebugString&
  94. TDebugString::
  95. operator=(
  96. IN const TDebugString& String
  97. );
  98. TDebugString::
  99. TDebugString(
  100. IN const TDebugString &String
  101. );
  102. VOID
  103. TDebugString::
  104. vFree(
  105. IN LPTSTR pszString
  106. );
  107. LPTSTR
  108. TDebugString::
  109. vsntprintf(
  110. IN LPCTSTR szFmt,
  111. IN va_list pArgs
  112. ) const;
  113. LPTSTR m_pszString;
  114. static TCHAR gszNullState[2];
  115. };
  116. DEBUG_NS_END
  117. #endif