2007-06-08 09:23:23 +00:00
< html >
< head >
2020-10-12 18:22:57 +01:00
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
2007-12-14 10:11:21 +00:00
< title > bad_expression</ title >
2010-07-08 22:49:58 +00:00
< link rel = "stylesheet" href = "../../../../../../doc/src/boostbook.css" type = "text/css" >
2019-10-26 10:51:25 +01:00
< meta name = "generator" content = "DocBook XSL Stylesheets V1.79.1" >
2022-03-08 11:26:11 +00:00
< link rel = "home" href = "../../index.html" title = "Boost.Regex 7.0.1" >
2007-12-14 10:11:21 +00:00
< link rel = "up" href = "../ref.html" title = "Reference" >
< link rel = "prev" href = "regex_token_iterator.html" title = "regex_token_iterator" >
< link rel = "next" href = "syntax_option_type.html" title = "syntax_option_type" >
2024-03-23 19:03:45 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2007-06-08 09:23:23 +00:00
</ head >
< body bgcolor = "white" text = "black" link = "#0000FF" vlink = "#840084" alink = "#0000FF" >
2007-08-13 17:54:01 +00:00
< table cellpadding = "2" width = "100%" >< tr >
2007-06-08 09:23:23 +00:00
< td valign = "top" >< img alt = "Boost C++ Libraries" width = "277" height = "86" src = "../../../../../../boost.png" ></ td >
2008-04-11 08:53:54 +00:00
< td align = "center" >< a href = "../../../../../../index.html" > Home</ a ></ td >
2007-06-08 09:23:23 +00:00
< td align = "center" >< a href = "../../../../../../libs/libraries.htm" > Libraries</ a ></ td >
2008-07-25 09:28:01 +00:00
< td align = "center" >< a href = "http://www.boost.org/users/people.html" > People</ a ></ td >
< td align = "center" >< a href = "http://www.boost.org/users/faq.html" > FAQ</ a ></ td >
2007-06-08 09:23:23 +00:00
< td align = "center" >< a href = "../../../../../../more/index.htm" > More</ a ></ td >
2007-08-13 17:54:01 +00:00
</ tr ></ table >
2007-06-08 09:23:23 +00:00
< hr >
< div class = "spirit-nav" >
2010-07-08 22:49:58 +00:00
< a accesskey = "p" href = "regex_token_iterator.html" >< img src = "../../../../../../doc/src/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../ref.html" >< img src = "../../../../../../doc/src/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../../index.html" >< img src = "../../../../../../doc/src/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "syntax_option_type.html" >< img src = "../../../../../../doc/src/images/next.png" alt = "Next" ></ a >
2007-06-08 09:23:23 +00:00
</ div >
2013-12-14 17:42:13 +00:00
< div class = "section" >
2007-06-08 09:23:23 +00:00
< div class = "titlepage" >< div >< div >< h3 class = "title" >
2011-01-01 12:27:00 +00:00
< a name = "boost_regex.ref.bad_expression" ></ a >< a class = "link" href = "bad_expression.html" title = "bad_expression" > bad_expression</ a >
2007-12-14 10:11:21 +00:00
</ h3 ></ div ></ div ></ div >
2011-12-24 17:51:57 +00:00
< h5 >
< a name = "boost_regex.ref.bad_expression.h0" ></ a >
2012-11-29 10:28:07 +00:00
< span class = "phrase" >< a name = "boost_regex.ref.bad_expression.synopsis" ></ a ></ span >< a class = "link" href = "bad_expression.html#boost_regex.ref.bad_expression.synopsis" > Synopsis</ a >
2007-12-14 10:11:21 +00:00
</ h5 >
< pre class = "programlisting" >< span class = "preprocessor" > #include</ span > < span class = "special" > < </ span >< span class = "identifier" > boost</ span >< span class = "special" > /</ span >< span class = "identifier" > pattern_except</ span >< span class = "special" > .</ span >< span class = "identifier" > hpp</ span >< span class = "special" > > </ span >
2007-06-08 09:23:23 +00:00
</ pre >
< p >
2007-12-14 10:11:21 +00:00
The class < code class = "computeroutput" >< span class = "identifier" > regex_error</ span ></ code > defines
2007-06-08 09:23:23 +00:00
the type of objects thrown as exceptions to report errors during the conversion
from a string representing a regular expression to a finite state machine.
</ p >
2007-12-14 10:11:21 +00:00
< pre class = "programlisting" >< span class = "keyword" > namespace</ span > < span class = "identifier" > boost</ span >< span class = "special" > {</ span >
2007-06-08 09:23:23 +00:00
< span class = "keyword" > class</ span > < span class = "identifier" > regex_error</ span > < span class = "special" > :</ span > < span class = "keyword" > public</ span > < span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > runtime_error</ span >
< span class = "special" > {</ span >
< span class = "keyword" > public</ span >< span class = "special" > :</ span >
< span class = "keyword" > explicit</ span > < span class = "identifier" > regex_error</ span >< span class = "special" > (</ span >< span class = "keyword" > const</ span > < span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > string</ span >< span class = "special" > & </ span > < span class = "identifier" > s</ span >< span class = "special" > ,</ span > < span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > err</ span >< span class = "special" > ,</ span > < span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > ptrdiff_t</ span > < span class = "identifier" > pos</ span >< span class = "special" > );</ span >
< span class = "keyword" > explicit</ span > < span class = "identifier" > regex_error</ span >< span class = "special" > (</ span >< span class = "identifier" > boost</ span >< span class = "special" > ::</ span >< span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > err</ span >< span class = "special" > );</ span >
< span class = "identifier" > boost</ span >< span class = "special" > ::</ span >< span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > code</ span >< span class = "special" > ()</ span >< span class = "keyword" > const</ span >< span class = "special" > ;</ span >
< span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > ptrdiff_t</ span > < span class = "identifier" > position</ span >< span class = "special" > ()</ span >< span class = "keyword" > const</ span >< span class = "special" > ;</ span >
< span class = "special" > };</ span >
2011-07-21 10:01:09 +00:00
< span class = "keyword" > typedef</ span > < span class = "identifier" > regex_error</ span > < span class = "identifier" > bad_pattern</ span >< span class = "special" > ;</ span > < span class = "comment" > // for backwards compatibility</ span >
< span class = "keyword" > typedef</ span > < span class = "identifier" > regex_error</ span > < span class = "identifier" > bad_expression</ span >< span class = "special" > ;</ span > < span class = "comment" > // for backwards compatibility</ span >
< span class = "special" > }</ span > < span class = "comment" > // namespace boost</ span >
</ pre >
2011-12-24 17:51:57 +00:00
< h5 >
< a name = "boost_regex.ref.bad_expression.h1" ></ a >
2012-11-29 10:28:07 +00:00
< span class = "phrase" >< a name = "boost_regex.ref.bad_expression.description" ></ a ></ span >< a class = "link" href = "bad_expression.html#boost_regex.ref.bad_expression.description" > Description</ a >
2007-12-14 10:11:21 +00:00
</ h5 >
< pre class = "programlisting" >< span class = "identifier" > regex_error</ span >< span class = "special" > (</ span >< span class = "keyword" > const</ span > < span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > string</ span >< span class = "special" > & </ span > < span class = "identifier" > s</ span >< span class = "special" > ,</ span > < span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > err</ span >< span class = "special" > ,</ span > < span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > ptrdiff_t</ span > < span class = "identifier" > pos</ span >< span class = "special" > );</ span >
2007-06-08 09:23:23 +00:00
< span class = "identifier" > regex_error</ span >< span class = "special" > (</ span >< span class = "identifier" > boost</ span >< span class = "special" > ::</ span >< span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > err</ span >< span class = "special" > );</ span >
</ pre >
< p >
2007-12-14 10:11:21 +00:00
< span class = "bold" >< strong > Effects:</ strong ></ span > Constructs an object of class regex_error.
2007-06-08 09:23:23 +00:00
</ p >
2007-12-14 10:11:21 +00:00
< pre class = "programlisting" >< span class = "identifier" > boost</ span >< span class = "special" > ::</ span >< span class = "identifier" > regex_constants</ span >< span class = "special" > ::</ span >< span class = "identifier" > error_type</ span > < span class = "identifier" > code</ span >< span class = "special" > ()</ span >< span class = "keyword" > const</ span >< span class = "special" > ;</ span >
2007-06-08 09:23:23 +00:00
</ pre >
< p >
2007-12-14 10:11:21 +00:00
< span class = "bold" >< strong > Effects:</ strong ></ span > returns the error code that represents
2007-06-08 09:23:23 +00:00
parsing error that occurred.
</ p >
2011-12-24 17:51:57 +00:00
< pre class = "programlisting" >< span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > ptrdiff_t</ span > < span class = "identifier" > position</ span >< span class = "special" > ()</ span >< span class = "keyword" > const</ span >< span class = "special" > ;</ span >
2007-06-08 09:23:23 +00:00
</ pre >
< p >
2007-12-14 10:11:21 +00:00
< span class = "bold" >< strong > Effects:</ strong ></ span > returns the location in the expression
2007-06-08 09:23:23 +00:00
where parsing stopped.
</ p >
< p >
2007-12-14 10:11:21 +00:00
Footnotes: the choice of < code class = "computeroutput" >< span class = "identifier" > std</ span >< span class = "special" > ::</ span >< span class = "identifier" > runtime_error</ span ></ code >
as the base class for < code class = "computeroutput" >< span class = "identifier" > regex_error</ span ></ code >
2007-06-08 09:23:23 +00:00
is moot; depending upon how the library is used exceptions may be either
logic errors (programmer supplied expressions) or run time errors (user supplied
2007-12-14 10:11:21 +00:00
expressions). The library previously used < code class = "computeroutput" >< span class = "identifier" > bad_pattern</ span ></ code >
and < code class = "computeroutput" >< span class = "identifier" > bad_expression</ span ></ code > for errors,
these have been replaced by the single class < code class = "computeroutput" >< span class = "identifier" > regex_error</ span ></ code >
2007-06-08 09:23:23 +00:00
to keep the library in synchronization with the < a href = "http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target = "_top" > Technical
2007-10-06 17:46:25 +00:00
Report on C++ Library Extensions</ a > .
2007-06-08 09:23:23 +00:00
</ p >
</ div >
2024-03-23 19:03:45 +00:00
< div class = "copyright-footer" > Copyright © 1998-2013 John Maddock< p >
2007-11-07 03:23:31 +00:00
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at < a href = "http://www.boost.org/LICENSE_1_0.txt" target = "_top" > http://www.boost.org/LICENSE_1_0.txt</ a > )
2007-12-14 10:11:21 +00:00
</ p >
2024-03-23 19:03:45 +00:00
</ div >
2007-06-08 09:23:23 +00:00
< hr >
< div class = "spirit-nav" >
2010-07-08 22:49:58 +00:00
< a accesskey = "p" href = "regex_token_iterator.html" >< img src = "../../../../../../doc/src/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../ref.html" >< img src = "../../../../../../doc/src/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../../index.html" >< img src = "../../../../../../doc/src/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "syntax_option_type.html" >< img src = "../../../../../../doc/src/images/next.png" alt = "Next" ></ a >
2007-06-08 09:23:23 +00:00
</ div >
</ body >
</ html >