imgtools/imglib/boostlibrary/boost/regex/pattern_except.hpp
author jascui
Mon, 29 Nov 2010 15:46:44 +0800
changeset 711 03a6f48f6e14
parent 600 6d08f4a05d93
permissions -rw-r--r--
Updating release text
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
/*
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
 * Copyright (c) 1998-2002
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
 * John Maddock
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
 * Use, modification and distribution are subject to the 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
 * Boost Software License, Version 1.0. (See accompanying file 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
 *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
 /*
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
  *   LOCATION:    see http://www.boost.org for most recent version.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
  *   FILE         pattern_except.hpp
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
  *   VERSION      see <boost/version.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
  *   DESCRIPTION: Declares pattern-matching exception classes.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
  */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
#ifndef BOOST_RE_PAT_EXCEPT_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
#define BOOST_RE_PAT_EXCEPT_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
#ifndef BOOST_REGEX_CONFIG_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
#include <boost/regex/config.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
#include <stdexcept>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
#include <cstddef>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
#include <boost/regex/v4/error_type.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
namespace boost{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
#pragma warning(push)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
#pragma warning(disable: 4103)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
#ifdef BOOST_HAS_ABI_HEADERS
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
#  include BOOST_ABI_PREFIX
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
#pragma warning(pop)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
#pragma warning(push)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
#pragma warning(disable : 4275)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    46
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    47
class BOOST_REGEX_DECL regex_error : public std::runtime_error
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    48
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    49
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    50
   explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    51
   explicit regex_error(regex_constants::error_type err);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    52
   ~regex_error() throw();
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    53
   regex_constants::error_type code()const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    54
   { return m_error_code; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    55
   std::ptrdiff_t position()const
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    56
   { return m_position; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    57
   void raise()const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    58
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    59
   regex_constants::error_type m_error_code;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    60
   std::ptrdiff_t m_position;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    61
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    62
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    63
typedef regex_error bad_pattern;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    64
typedef regex_error bad_expression;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    65
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    66
namespace re_detail{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    67
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    68
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    69
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    70
template <class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    71
void raise_error(const traits& t, regex_constants::error_type code)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    72
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    73
   (void)t;  // warning suppression
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    74
   std::runtime_error e(t.error_string(code));
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    75
   ::boost::re_detail::raise_runtime_error(e);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    76
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    77
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    78
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    79
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    80
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    81
#pragma warning(pop)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    82
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    83
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    84
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    85
#pragma warning(push)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    86
#pragma warning(disable: 4103)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    87
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    88
#ifdef BOOST_HAS_ABI_HEADERS
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    89
#  include BOOST_ABI_SUFFIX
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    90
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    91
#ifdef BOOST_MSVC
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    92
#pragma warning(pop)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    93
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    94
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    95
} // namespace boost
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    96
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    97
#endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    98
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    99
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   100