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.

102 lines
2.6 KiB

  1. #ifndef _utils_h
  2. #define _utils_h
  3. void MapEventToSeverity(DWORD dwEvent, CString& sResult);
  4. extern LONG FindWholeWord(LPCTSTR pszTemplate, LPCTSTR pszText);
  5. extern LONG FindSubstring(LPCTSTR pszTemplate, LPCTSTR pszText);
  6. extern void DecString(CString& sValue, int iValue);
  7. extern void DecString(CString& sValue, long lValue);
  8. extern void DecString(CString& sValue, DWORD dwValue);
  9. extern void GenerateRangeMessage(CString& sMessage, LONG nMin, LONG nMax);
  10. extern SCODE GetThousandSeparator(TCHAR* pch);
  11. extern BOOL IsDecimalInteger(LPCTSTR pszValue);
  12. extern SCODE AsciiToLong(LPCTSTR pszValue, LONG* plResult);
  13. //-------------------------------------------------------
  14. // Class: CList
  15. //
  16. // Description:
  17. // This class implements a circularly linked list.
  18. //
  19. // Methods:
  20. //-------------------------------------------------------
  21. // CList::CList(void* pValue)
  22. //
  23. // Construct a node and associate the pointer value
  24. // with it. The pointer is declared to be type
  25. // void* so that this class is as generic as possible.
  26. //
  27. // Input:
  28. // pValue = Pointer to the value to associate with this node
  29. //
  30. // Returns: Nothing
  31. //
  32. //-------------------------------------------------------
  33. // void Link(CList*& pndHead)
  34. //
  35. // Add this node to the end of the list pointed to by
  36. // pndHead. If pndHead is NULL, then set pndHead to
  37. // the address of this node.
  38. //
  39. // Input:
  40. // pndHead = A reference to the head node pointer
  41. //
  42. // Returns: Nothing
  43. //
  44. //-------------------------------------------------------
  45. // void Unlink(CList*& pndHead)
  46. //
  47. // Unlink this node from the list it is on. If this node
  48. // is the only element on the list, set the value of pndHead
  49. // to NULL to indicate that the list is empty.
  50. //
  51. // Input:
  52. // pndHead = A reference to the head node pointer.
  53. //
  54. // Returns: nothing
  55. //
  56. //-------------------------------------------------------
  57. // CList* Next()
  58. //
  59. // Return a pointer to the next node in the list.
  60. //
  61. // Input: None
  62. //
  63. // Returns: A pointer to the next node on the list
  64. //
  65. //-------------------------------------------------------
  66. // CList* Prev()
  67. //
  68. // Return a pointer to the previous node in the list.
  69. //
  70. // Input: None
  71. //
  72. // Returns: A pointer to the previous node on the list.
  73. //
  74. //-------------------------------------------------------
  75. // void* Value()
  76. //
  77. // Return the "value pointer" attached to this node.
  78. //
  79. // Input: None
  80. //
  81. // Returns: The node's value.
  82. //
  83. //--------------------------------------------------------
  84. class CList
  85. {
  86. public:
  87. CList();
  88. void Link(CList*& pndHead);
  89. void Unlink(CList*& pndHead);
  90. CList* Next() {return m_pndNext;}
  91. CList* Prev() {return m_pndPrev;}
  92. private:
  93. CList* m_pndPrev;
  94. CList* m_pndNext;
  95. };
  96. #endif