os/ossrv/ossrv_pub/boost_apis/boost/regex/pattern_except.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
 *
sl@0
     3
 * Copyright (c) 1998-2002
sl@0
     4
 * John Maddock
sl@0
     5
 *
sl@0
     6
 * Use, modification and distribution are subject to the 
sl@0
     7
 * Boost Software License, Version 1.0. (See accompanying file 
sl@0
     8
 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sl@0
     9
 *
sl@0
    10
 */
sl@0
    11
 
sl@0
    12
 /*
sl@0
    13
  *   LOCATION:    see http://www.boost.org for most recent version.
sl@0
    14
  *   FILE         pattern_except.hpp
sl@0
    15
  *   VERSION      see <boost/version.hpp>
sl@0
    16
  *   DESCRIPTION: Declares pattern-matching exception classes.
sl@0
    17
  */
sl@0
    18
sl@0
    19
#ifndef BOOST_RE_PAT_EXCEPT_HPP
sl@0
    20
#define BOOST_RE_PAT_EXCEPT_HPP
sl@0
    21
sl@0
    22
#ifndef BOOST_REGEX_CONFIG_HPP
sl@0
    23
#include <boost/regex/config.hpp>
sl@0
    24
#endif
sl@0
    25
sl@0
    26
#include <stdexcept>
sl@0
    27
#include <cstddef>
sl@0
    28
#include <boost/regex/v4/error_type.hpp>
sl@0
    29
sl@0
    30
namespace boost{
sl@0
    31
sl@0
    32
#ifdef BOOST_HAS_ABI_HEADERS
sl@0
    33
#  include BOOST_ABI_PREFIX
sl@0
    34
#endif
sl@0
    35
sl@0
    36
#ifdef BOOST_MSVC
sl@0
    37
#pragma warning(push)
sl@0
    38
#pragma warning(disable : 4275)
sl@0
    39
#endif
sl@0
    40
   class BOOST_REGEX_DECL regex_error : public std::runtime_error
sl@0
    41
{
sl@0
    42
public:
sl@0
    43
   explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0);
sl@0
    44
   explicit regex_error(regex_constants::error_type err);
sl@0
    45
   ~regex_error() throw();
sl@0
    46
   regex_constants::error_type code()const
sl@0
    47
   { return m_error_code; }
sl@0
    48
   std::ptrdiff_t position()const
sl@0
    49
   { return m_position; }
sl@0
    50
   void raise()const;
sl@0
    51
private:
sl@0
    52
   regex_constants::error_type m_error_code;
sl@0
    53
   std::ptrdiff_t m_position;
sl@0
    54
};
sl@0
    55
sl@0
    56
typedef regex_error bad_pattern;
sl@0
    57
typedef regex_error bad_expression;
sl@0
    58
sl@0
    59
namespace re_detail{
sl@0
    60
sl@0
    61
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
sl@0
    62
sl@0
    63
template <class traits>
sl@0
    64
void raise_error(const traits& t, regex_constants::error_type code)
sl@0
    65
{
sl@0
    66
   (void)t;  // warning suppression
sl@0
    67
   std::runtime_error e(t.error_string(code));
sl@0
    68
   ::boost::re_detail::raise_runtime_error(e);
sl@0
    69
}
sl@0
    70
sl@0
    71
}
sl@0
    72
sl@0
    73
sl@0
    74
#ifdef BOOST_HAS_ABI_HEADERS
sl@0
    75
#  include BOOST_ABI_SUFFIX
sl@0
    76
#endif
sl@0
    77
sl@0
    78
} // namespace boost
sl@0
    79
sl@0
    80
#endif
sl@0
    81
sl@0
    82
sl@0
    83