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.

157 lines
5.6 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: winstl/toolhelp/error/exceptions.hpp
  3. *
  4. * Purpose: Exception classes for TOOLHELP components.
  5. *
  6. * Created: 21st May 2005
  7. * Updated: 10th August 2009
  8. *
  9. * Thanks: To Pablo for contributing this great library.
  10. *
  11. * Home: http://stlsoft.org/
  12. *
  13. * Copyright (c) 2005-2009, Pablo Aguilar
  14. * Copyright (c) 2006-2007, Matthew Wilson
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without
  18. * modification, are permitted provided that the following conditions are met:
  19. *
  20. * - Redistributions of source code must retain the above copyright notice, this
  21. * list of conditions and the following disclaimer.
  22. * - Redistributions in binary form must reproduce the above copyright notice,
  23. * this list of conditions and the following disclaimer in the documentation
  24. * and/or other materials provided with the distribution.
  25. * - Neither the name(s) of Matthew Wilson and Synesis Software, nor Pablo
  26. * Aguilar, nor the names of any contributors may be used to endorse or
  27. * promote products derived from this software without specific prior written
  28. * permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  31. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  33. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  34. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  35. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  36. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  37. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  38. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  39. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGE.
  41. *
  42. * ////////////////////////////////////////////////////////////////////// */
  43. /** \file winstl/toolhelp/error/exceptions.hpp
  44. *
  45. * \brief [C++ only] Exception classes for the
  46. * (\ref group__library__windows_toolhelp "Windows ToolHelp" Library).
  47. */
  48. #ifndef WINSTL_INCL_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION
  49. #define WINSTL_INCL_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION
  50. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  51. # define WINSTL_VER_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION_MAJOR 2
  52. # define WINSTL_VER_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION_MINOR 0
  53. # define WINSTL_VER_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION_REVISION 2
  54. # define WINSTL_VER_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION_EDIT 13
  55. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  56. /* /////////////////////////////////////////////////////////////////////////
  57. * Includes
  58. */
  59. #ifndef WINSTL_INCL_WINSTL_H_WINSTL
  60. # include <winstl/winstl.h>
  61. #endif /* !WINSTL_INCL_WINSTL_H_WINSTL */
  62. #ifdef STLSOFT_CF_PRAGMA_ONCE_SUPPORT
  63. # pragma once
  64. #endif /* STLSOFT_CF_PRAGMA_ONCE_SUPPORT */
  65. #ifndef WINSTL_INCL_WINSTL_ERROR_HPP_WINDOWS_EXCEPTIONS
  66. # include <winstl/error/exceptions.hpp>
  67. #endif /* !WINSTL_INCL_WINSTL_ERROR_HPP_WINDOWS_EXCEPTIONS */
  68. #ifndef STLSOFT_INCL_H_TLHELP32
  69. # define STLSOFT_INCL_H_TLHELP32
  70. # include <tlhelp32.h>
  71. #endif /* !STLSOFT_INCL_H_TLHELP32 */
  72. /* /////////////////////////////////////////////////////////////////////////
  73. * Namespace
  74. */
  75. #ifndef _WINSTL_NO_NAMESPACE
  76. # if defined(_STLSOFT_NO_NAMESPACE) || \
  77. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  78. /* There is no stlsoft namespace, so must define ::winstl */
  79. namespace winstl
  80. {
  81. # else
  82. /* Define stlsoft::winstl_project */
  83. namespace stlsoft
  84. {
  85. namespace winstl_project
  86. {
  87. # endif /* _STLSOFT_NO_NAMESPACE */
  88. #endif /* !_WINSTL_NO_NAMESPACE */
  89. /* /////////////////////////////////////////////////////////////////////////
  90. * Classes
  91. */
  92. /** \brief Root exception thrown by
  93. * the \ref group__library__windows_toolhelp "ToolHelp" Library.
  94. *
  95. * \ingroup group__library__windows_toolhelp
  96. */
  97. struct toolhelp_exception
  98. : public windows_exception
  99. {
  100. /// \name Member Types
  101. /// @{
  102. public:
  103. typedef windows_exception parent_class_type;
  104. typedef toolhelp_exception class_type;
  105. typedef parent_class_type::error_code_type error_code_type;
  106. /// @}
  107. /// \name Construction
  108. /// @{
  109. public:
  110. /// \brief Constructs an instance from the given error code
  111. ///
  112. /// \param err The error code that is passed to the parent class (winstl::windows_exception) constructor
  113. ss_explicit_k toolhelp_exception(error_code_type err)
  114. : parent_class_type(err)
  115. {}
  116. /// \brief Constructs an instance from the given message and error code
  117. ///
  118. /// \param reason The reason that is passed to the parent class (winstl::windows_exception) constructor
  119. /// \param err The error code that is passed to the parent class (winstl::windows_exception) constructor
  120. toolhelp_exception(char const* reason, error_code_type err)
  121. : parent_class_type(reason, err)
  122. {}
  123. /// @}
  124. };
  125. /* ////////////////////////////////////////////////////////////////////// */
  126. #ifndef _WINSTL_NO_NAMESPACE
  127. # if defined(_STLSOFT_NO_NAMESPACE) || \
  128. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  129. } // namespace winstl
  130. # else
  131. } // namespace winstl_project
  132. } // namespace stlsoft
  133. # endif /* _STLSOFT_NO_NAMESPACE */
  134. #endif /* !_WINSTL_NO_NAMESPACE */
  135. /* ////////////////////////////////////////////////////////////////////// */
  136. #endif // WINSTL_INCL_WINSTL_TOOLHELP_ERROR_HPP_SEQUENCE_EXCEPTION
  137. /* ///////////////////////////// end of file //////////////////////////// */