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.

145 lines
4.6 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/error/project_exception.hpp
  3. *
  4. * Purpose: Basic exception classes.
  5. *
  6. * Created: 19th January 2002
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2002-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are
  16. * met:
  17. *
  18. * - Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * - Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
  24. * names of any contributors may be used to endorse or promote products
  25. * derived from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  28. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  29. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  31. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  32. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  33. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  34. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  35. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. * ////////////////////////////////////////////////////////////////////// */
  40. /** \file stlsoft/error/project_exception.hpp
  41. *
  42. * \brief [C++ only] Definition of the stlsoft::project_exception root
  43. * exception class
  44. * (\ref group__library__error "Error" Library).
  45. */
  46. #ifndef STLSOFT_INCL_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION
  47. #define STLSOFT_INCL_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION
  48. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  49. # define STLSOFT_VER_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION_MAJOR 5
  50. # define STLSOFT_VER_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION_MINOR 0
  51. # define STLSOFT_VER_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION_REVISION 1
  52. # define STLSOFT_VER_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION_EDIT 50
  53. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  54. /* /////////////////////////////////////////////////////////////////////////
  55. * Compatibility
  56. */
  57. /*
  58. [DocumentationStatus:Ready]
  59. */
  60. /* /////////////////////////////////////////////////////////////////////////
  61. * Includes
  62. */
  63. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  64. # include <stlsoft/stlsoft.h>
  65. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  66. #ifndef STLSOFT_INCL_EXCEPTION
  67. # define STLSOFT_INCL_EXCEPTION
  68. # include <exception>
  69. #endif /* !STLSOFT_INCL_EXCEPTION */
  70. /* /////////////////////////////////////////////////////////////////////////
  71. * Namespace
  72. */
  73. #ifndef _STLSOFT_NO_NAMESPACE
  74. namespace stlsoft
  75. {
  76. #endif /* _STLSOFT_NO_NAMESPACE */
  77. /* /////////////////////////////////////////////////////////////////////////
  78. * Classes
  79. */
  80. /** \brief Root exception class for sub-project platform-specific
  81. * exceptions.
  82. *
  83. * \ingroup group__library__error
  84. *
  85. */
  86. class project_exception
  87. #if defined(STLSOFT_COMPILER_IS_DMC)
  88. : public std::exception
  89. #else /* ? compiler */
  90. : public stlsoft_ns_qual_std(exception)
  91. #endif /* compiler */
  92. {
  93. /// \name Types
  94. /// @{
  95. public:
  96. /// The type of the current instantiation
  97. typedef project_exception class_type;
  98. /// The parent type
  99. #if defined(STLSOFT_COMPILER_IS_DMC)
  100. typedef std::exception parent_class_type;
  101. #else /* ? compiler */
  102. typedef stlsoft_ns_qual_std(exception) parent_class_type;
  103. #endif /* compiler */
  104. /// @}
  105. /// \name Construction
  106. /// @{
  107. public:
  108. /// Default constructor
  109. project_exception()
  110. {}
  111. /// @}
  112. /// \name Accessors
  113. /// @{
  114. public:
  115. /// Returns a human-readable string describing the exception condition
  116. virtual char const* what() const stlsoft_throw_0() = 0;
  117. /// @}
  118. };
  119. /* ////////////////////////////////////////////////////////////////////// */
  120. #ifndef _STLSOFT_NO_NAMESPACE
  121. } // namespace stlsoft
  122. #endif /* _STLSOFT_NO_NAMESPACE */
  123. /* ////////////////////////////////////////////////////////////////////// */
  124. #endif /* !STLSOFT_INCL_STLSOFT_ERROR_HPP_PROJECT_EXCEPTION */
  125. /* ///////////////////////////// end of file //////////////////////////// */