sl@0: /* sl@0: * sl@0: * Copyright (c) 1998-2002 sl@0: * John Maddock sl@0: * sl@0: * Use, modification and distribution are subject to the sl@0: * Boost Software License, Version 1.0. (See accompanying file sl@0: * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: * sl@0: */ sl@0: sl@0: /* sl@0: * LOCATION: see http://www.boost.org for most recent version. sl@0: * FILE pattern_except.hpp sl@0: * VERSION see sl@0: * DESCRIPTION: Declares pattern-matching exception classes. sl@0: */ sl@0: sl@0: #ifndef BOOST_RE_PAT_EXCEPT_HPP sl@0: #define BOOST_RE_PAT_EXCEPT_HPP sl@0: sl@0: #ifndef BOOST_REGEX_CONFIG_HPP sl@0: #include sl@0: #endif sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace boost{ sl@0: sl@0: #ifdef BOOST_HAS_ABI_HEADERS sl@0: # include BOOST_ABI_PREFIX sl@0: #endif sl@0: sl@0: #ifdef BOOST_MSVC sl@0: #pragma warning(push) sl@0: #pragma warning(disable : 4275) sl@0: #endif sl@0: class BOOST_REGEX_DECL regex_error : public std::runtime_error sl@0: { sl@0: public: sl@0: explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0); sl@0: explicit regex_error(regex_constants::error_type err); sl@0: ~regex_error() throw(); sl@0: regex_constants::error_type code()const sl@0: { return m_error_code; } sl@0: std::ptrdiff_t position()const sl@0: { return m_position; } sl@0: void raise()const; sl@0: private: sl@0: regex_constants::error_type m_error_code; sl@0: std::ptrdiff_t m_position; sl@0: }; sl@0: sl@0: typedef regex_error bad_pattern; sl@0: typedef regex_error bad_expression; sl@0: sl@0: namespace re_detail{ sl@0: sl@0: BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex); sl@0: sl@0: template sl@0: void raise_error(const traits& t, regex_constants::error_type code) sl@0: { sl@0: (void)t; // warning suppression sl@0: std::runtime_error e(t.error_string(code)); sl@0: ::boost::re_detail::raise_runtime_error(e); sl@0: } sl@0: sl@0: } sl@0: sl@0: sl@0: #ifdef BOOST_HAS_ABI_HEADERS sl@0: # include BOOST_ABI_SUFFIX sl@0: #endif sl@0: sl@0: } // namespace boost sl@0: sl@0: #endif sl@0: sl@0: sl@0: