2000-09-26 11:48:28 +00:00
|
|
|
/*
|
|
|
|
*
|
2002-04-24 10:50:23 +00:00
|
|
|
* Copyright (c) 1998-2002
|
2005-01-21 17:22:39 +00:00
|
|
|
* John Maddock
|
2000-09-26 11:48:28 +00:00
|
|
|
*
|
2003-10-04 11:29:20 +00:00
|
|
|
* Use, modification and distribution are subject to the
|
2003-09-30 13:02:51 +00:00
|
|
|
* Boost Software License, Version 1.0. (See accompanying file
|
|
|
|
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
2000-09-26 11:48:28 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* LOCATION: see http://www.boost.org for most recent version.
|
2001-09-19 11:48:51 +00:00
|
|
|
* FILE pattern_except.hpp
|
2001-09-30 10:30:14 +00:00
|
|
|
* VERSION see <boost/version.hpp>
|
2000-09-26 11:48:28 +00:00
|
|
|
* DESCRIPTION: Declares pattern-matching exception classes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
|
|
|
#define BOOST_RE_PAT_EXCEPT_HPP
|
|
|
|
|
2003-05-17 11:45:48 +00:00
|
|
|
#ifndef BOOST_REGEX_CONFIG_HPP
|
2001-09-18 11:13:39 +00:00
|
|
|
#include <boost/regex/config.hpp>
|
2003-05-17 11:45:48 +00:00
|
|
|
#endif
|
2000-09-26 11:48:28 +00:00
|
|
|
|
2005-01-13 17:06:21 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <boost/regex/v4/error_type.hpp>
|
|
|
|
|
2000-09-26 11:48:28 +00:00
|
|
|
namespace boost{
|
|
|
|
|
2003-08-14 10:22:05 +00:00
|
|
|
#ifdef BOOST_HAS_ABI_HEADERS
|
2003-08-12 11:23:02 +00:00
|
|
|
# include BOOST_ABI_PREFIX
|
2000-09-26 11:48:28 +00:00
|
|
|
#endif
|
|
|
|
|
2002-10-21 11:03:05 +00:00
|
|
|
#ifdef BOOST_MSVC
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable : 4275)
|
|
|
|
#endif
|
2005-01-13 17:06:21 +00:00
|
|
|
class BOOST_REGEX_DECL regex_error : public std::runtime_error
|
2000-09-26 11:48:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-01-13 17:06:21 +00:00
|
|
|
explicit regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos);
|
|
|
|
explicit regex_error(regex_constants::error_type err);
|
|
|
|
~regex_error() throw();
|
|
|
|
regex_constants::error_type code()const
|
|
|
|
{ return m_error_code; }
|
|
|
|
std::ptrdiff_t position()const
|
|
|
|
{ return m_position; }
|
|
|
|
void raise()const;
|
|
|
|
private:
|
|
|
|
regex_constants::error_type m_error_code;
|
|
|
|
std::ptrdiff_t m_position;
|
2000-09-26 11:48:28 +00:00
|
|
|
};
|
|
|
|
|
2005-01-13 17:06:21 +00:00
|
|
|
typedef regex_error bad_pattern;
|
|
|
|
typedef regex_error bad_expression;
|
|
|
|
|
|
|
|
namespace re_detail{
|
|
|
|
|
|
|
|
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
|
|
|
|
|
|
|
|
template <class traits>
|
|
|
|
void raise_error(const traits& t, regex_constants::error_type code)
|
2000-09-26 11:48:28 +00:00
|
|
|
{
|
2005-01-13 17:06:21 +00:00
|
|
|
(void)t; // warning suppression
|
|
|
|
std::runtime_error e(t.error_string(code));
|
|
|
|
::boost::re_detail::raise_runtime_error(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-09-26 11:48:28 +00:00
|
|
|
|
2003-08-14 10:22:05 +00:00
|
|
|
#ifdef BOOST_HAS_ABI_HEADERS
|
2003-08-12 11:23:02 +00:00
|
|
|
# include BOOST_ABI_SUFFIX
|
2000-09-26 11:48:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
} // namespace boost
|
|
|
|
|
|
|
|
#endif
|
2001-09-19 11:48:51 +00:00
|
|
|
|
2002-04-24 10:50:23 +00:00
|
|
|
|
2003-09-30 13:02:51 +00:00
|
|
|
|