| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | 
|---|
| 2 | <html> | 
|---|
| 3 |    <head> | 
|---|
| 4 |       <title>Boost.Regex: regex_error</title> | 
|---|
| 5 |       <meta name="generator" content="HTML Tidy, see www.w3.org"> | 
|---|
| 6 |       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | 
|---|
| 7 |       <link rel="stylesheet" type="text/css" href="../../../boost.css"> | 
|---|
| 8 |    </head> | 
|---|
| 9 |    <body> | 
|---|
| 10 |       <p></p> | 
|---|
| 11 |       <table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0"> | 
|---|
| 12 |          <tr> | 
|---|
| 13 |             <td valign="top" width="300"> | 
|---|
| 14 |                <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../boost.png" border="0"></a></h3> | 
|---|
| 15 |             </td> | 
|---|
| 16 |             <td width="353"> | 
|---|
| 17 |                <h1 align="center">Boost.Regex</h1> | 
|---|
| 18 |                <h2 align="center">class regex_error</h2> | 
|---|
| 19 |             </td> | 
|---|
| 20 |             <td width="50"> | 
|---|
| 21 |                <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3> | 
|---|
| 22 |             </td> | 
|---|
| 23 |          </tr> | 
|---|
| 24 |       </table> | 
|---|
| 25 |       <br> | 
|---|
| 26 |       <br> | 
|---|
| 27 |       <hr> | 
|---|
| 28 |       <h3>Synopsis</h3> | 
|---|
| 29 |       <p>#include <<a href="../../../boost/regex/pattern_except.hpp">boost/pattern_except.hpp</a>></p> | 
|---|
| 30 |       <p>The class <code>regex_error</code> defines the type of objects thrown as  | 
|---|
| 31 |          exceptions to report errors during the conversion from a string representing a  | 
|---|
| 32 |          regular expression to a finite state machine.  </p> | 
|---|
| 33 |       <pre> | 
|---|
| 34 | <b>namespace</b> boost{ | 
|---|
| 35 |  | 
|---|
| 36 | <b>class</b> regex_error : <b>public</b> std::runtime_error | 
|---|
| 37 | { | 
|---|
| 38 | <b>public</b>: | 
|---|
| 39 |    <b>explicit</b> regex_error(<b>const</b> std::string& s, <a href="error_type.html">regex_constants::error_type err</a>, std::ptrdiff_t pos); | 
|---|
| 40 |    <b>explicit</b> regex_error(<a href="error_type.html">boost::regex_constants::error_type err</a>); | 
|---|
| 41 |    <a href="error_type.html">boost::regex_constants::error_type</a> code()<b>const</b>; | 
|---|
| 42 |    std::ptrdiff_t position()<b>const</b>; | 
|---|
| 43 | }; | 
|---|
| 44 |  | 
|---|
| 45 | typedef regex_error bad_pattern; // for backwards compatibility | 
|---|
| 46 | typedef regex_error bad_expression; // for backwards compatibility | 
|---|
| 47 |  | 
|---|
| 48 | } // namespace boost | 
|---|
| 49 | </pre> | 
|---|
| 50 |       <h3>Description</h3> | 
|---|
| 51 |       <pre> | 
|---|
| 52 | regex_error(<b>const</b> std::string& s, <a href="error_type.html">regex_constants::error_type</a> err, std::ptrdiff_t pos); | 
|---|
| 53 | regex_error(<a href="error_type.html">boost::regex_constants::error_type err</a>);</pre> | 
|---|
| 54 |       <p><b>Effects:</b> Constructs an object of class <code>regex_error</code>.</p> | 
|---|
| 55 |       <pre> | 
|---|
| 56 | <a href="error_type.html">boost::regex_constants::error_type</a> code()<b>const</b>;</pre> | 
|---|
| 57 |       <p><b>Effects:</b> returns the error code that represents parsing error that occurred.</p> | 
|---|
| 58 |       <pre> | 
|---|
| 59 | std::ptrdiff_t position()<b>const</b>; </pre> | 
|---|
| 60 |       <p><b>Effects:</b> returns the location in the expression where parsing stopped.</p> | 
|---|
| 61 |       <P>Footnotes: the choice of <code>std::runtime_error</code> as the base class for <code> | 
|---|
| 62 |             regex_error</code> is moot; depending upon how the library is used  | 
|---|
| 63 |          exceptions may be either logic errors (programmer supplied expressions) or run  | 
|---|
| 64 |          time errors (user supplied expressions).  The library previously used <code>bad_pattern</code> | 
|---|
| 65 |          and <code>bad_expression</code> for errors, these have been replaced by the  | 
|---|
| 66 |          single class <code>regex_error</code> to keep the library in synchronization  | 
|---|
| 67 |          with the standardization proposal.</P> | 
|---|
| 68 |       <p></p> | 
|---|
| 69 |       <hr> | 
|---|
| 70 |       <p>Revised  | 
|---|
| 71 |          <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->  | 
|---|
| 72 |          24 June 2004   | 
|---|
| 73 |          <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> | 
|---|
| 74 |       <p><i>© Copyright John Maddock 1998-  | 
|---|
| 75 |             <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->  2004<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> | 
|---|
| 76 |       <P><I>Use, modification and distribution are subject to the Boost Software License,  | 
|---|
| 77 |             Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> | 
|---|
| 78 |             or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P> | 
|---|
| 79 |    </body> | 
|---|
| 80 | </html> | 
|---|
| 81 |  | 
|---|