Merging in changes trunk updates: adding standard error_info typedefs, updating the documentation.

[SVN r55094]
This commit is contained in:
Emil Dotchevski
2009-07-22 20:55:50 +00:00
parent 6a8b96d9c3
commit 0f5a51238b
64 changed files with 13772 additions and 8727 deletions

View File

@ -0,0 +1,64 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/all.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/all.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp</a></span>&gt;</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/>
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -38,7 +38,7 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/> </a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
</a><a href="diagnostic_information.html">diagnostic_information<br/> </a><a href="diagnostic_information.html">diagnostic_information<br/>
</a><a href="synopsis.html">Synopsis<br/> </a><a href="synopsis.html">Synopsis<br/>

View File

@ -0,0 +1,55 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_api_function.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_api_function.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_api_function_,int&gt; <span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,55 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_at_line.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_at_line.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_at_line_,int&gt; <span class="RenoLink"><a href="errinfo_at_line.html">errinfo_at_line</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_errno.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_errno.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;errno.h&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_errno_,int&gt; <span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_file_handle.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_file_handle.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
template &lt;class&gt; class weak_ptr;
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_handle_,weak_ptr&lt;FILE&gt; &gt; <span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_file_name.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_file_name.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_name_,std::string&gt; <span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_file_open_mode.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_file_open_mode.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_open_mode_,std::string&gt; <span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception/errinfo_type_info_name.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/errinfo_type_info_name.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_type_info_name_,std::string&gt; <span class="RenoLink"><a href="errinfo_type_info_name.html">errinfo_type_info_name</a></span>;</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -30,7 +30,14 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp<br/>
</a><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp<br/>
</a><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp<br/>
</a><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp<br/>
</a><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp<br/>
</a><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp<br/>
</a><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="synopsis.html">Synopsis<br/> </a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>

View File

@ -38,14 +38,14 @@ boost
<span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt; <span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span> class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_function,char const *&gt; throw_function; typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_function_,char const *&gt; throw_function;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_file,char const *&gt; throw_file; typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_file_,char const *&gt; throw_file;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_line,int&gt; throw_line;</span> typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_line_,int&gt; throw_line;</span>
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/> <div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost_exception_hpp.html">boost/exception.hpp<br/> </a><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/> </a><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/>
</a><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/> </a><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/>
</a><a href="boost_exception_info_hpp.html">boost/exception/info.hpp<br/> </a><a href="boost_exception_info_hpp.html">boost/exception/info.hpp<br/>

View File

@ -32,7 +32,7 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a></div> </a></div>
</div> </div>

View File

@ -21,21 +21,9 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception.hpp</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception.hpp</h2>
</div> </div>
<h3>Synopsis</h3> <p>This header has been deprecated.</p>
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt; <p>Please #include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt; instead.</p>
#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt; </div><div class="RenoAutoDIV"></div>
#include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying --> <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->

View File

@ -44,7 +44,7 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp<br/> </a><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="error_info_error_info.html">error_info::error_info<br/> </a><a href="error_info_error_info.html">error_info::error_info<br/>

View File

@ -37,7 +37,7 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="synopsis.html">Synopsis<br/> </a><a href="synopsis.html">Synopsis<br/>
</a><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;<br/> </a><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;<br/>
</a></div> </a></div>

View File

@ -48,7 +48,7 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="copy_exception.html">copy_exception<br/> </a><a href="copy_exception.html">copy_exception<br/>
</a><a href="current_exception.html">current_exception<br/> </a><a href="current_exception.html">current_exception<br/>
</a><a href="exception_ptr.html">exception_ptr<br/> </a><a href="exception_ptr.html">exception_ptr<br/>

View File

@ -63,13 +63,13 @@ else return &lt;unspecified-string-value&gt;;</pre>
</ul></div> </ul></div>
<div class="RenoIncludeDIV"><h4>Example:</h4> <div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink">diagnostic_information</span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p> <p>this is a possible output from the <span class="RenoLink">diagnostic_information</span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *) <pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt; Dynamic exception type: class boost::exception_detail::clone_impl&lt;struct fopen_error&gt;
std::exception::what: example_io error std::exception::what: example_io error
[struct tag_errno *] = 2, OS says "No such file or directory" [struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct tag_file_name *] = tmp1.txt [struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct tag_function *] = fopen [struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct tag_open_mode *] = rb</pre> [struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/> <div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>

View File

@ -0,0 +1,102 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_api_function</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_api_function</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_api_function_,int&gt; <span class="RenoLink">errinfo_api_function</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting the name of a relevant API function (which does not use exceptions to report errors) in exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink">errinfo_api_function</span>("fopen") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink">errinfo_api_function</span>("fread") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

101
doc/errinfo_at_line.html Normal file
View File

@ -0,0 +1,101 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_at_line</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_at_line</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_at_line_,int&gt; <span class="RenoLink">errinfo_at_line</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting a relevant text file line number, for example in parse error exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fopen") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fread") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

103
doc/errinfo_errno.html Normal file
View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_errno</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_errno</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;errno.h&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_errno_,int&gt; <span class="RenoLink">errinfo_errno</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting a relevant errno value in exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fopen") &lt;&lt;
boost::<span class="RenoLink">errinfo_errno</span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fread") &lt;&lt;
boost::<span class="RenoLink">errinfo_errno</span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,102 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_file_handle</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_file_handle</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
template &lt;class&gt; class weak_ptr;
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_handle_,weak_ptr&lt;FILE&gt; &gt; <span class="RenoLink">errinfo_file_handle</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting a relevant FILE pointer managed by a boost::shared_ptr&lt;FILE&gt; in exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fopen") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fread") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink">errinfo_file_handle</span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

103
doc/errinfo_file_name.html Normal file
View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_file_name</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_file_name</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_name_,std::string&gt; <span class="RenoLink">errinfo_file_name</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting a relevant file name in exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fopen") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink">errinfo_file_name</span>(file) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fread") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_file_open_mode</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_file_open_mode</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_open_mode_,std::string&gt; <span class="RenoLink">errinfo_file_open_mode</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting the string passed as a second argument to fopen in exceptions indicating fopen failures and deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h3>Example:</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;boost/weak_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;exception&gt;
struct error : virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr&lt;FILE&gt;
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_open_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fopen") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file) &lt;&lt;
boost::<span class="RenoLink">errinfo_file_open_mode</span>(mode) );
}
size_t
read_file( boost::shared_ptr&lt;FILE&gt; const &amp; f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
<span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(
file_read_error() &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>("fread") &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno) &lt;&lt;
boost::<span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>(f) );
return nr;
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>errinfo_type_info_name</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>errinfo_type_info_name</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_type_info_name_,std::string&gt; <span class="RenoLink">errinfo_type_info_name</span>;</span></span>
}</pre>
</div></div><p>This type is designed to be used as a standard <span class="RenoLink"><a href="error_info.html">error_info</a></span> instance for transporting strings returned by std::type_info::name in exceptions deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> objects.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -59,6 +59,15 @@ typedef boost::<span class="RenoLink">error_info</span>&lt;struct tag_errno,int&
if( int const * e=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) ) if( int const * e=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) )
.... ....
}</pre> }</pre>
<p>For convenience and uniformity, Boost Exception defines the following commonly used <span class="RenoLink">error_info</span> typedefs, ready for use with <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>:</p>
<div class="RenoPageList"><a href="errinfo_api_function.html">errinfo_api_function<br/>
</a><a href="errinfo_at_line.html">errinfo_at_line<br/>
</a><a href="errinfo_errno.html">errinfo_errno<br/>
</a><a href="errinfo_file_handle.html">errinfo_file_handle<br/>
</a><a href="errinfo_file_name.html">errinfo_file_name<br/>
</a><a href="errinfo_file_open_mode.html">errinfo_file_open_mode<br/>
</a><a href="errinfo_type_info_name.html">errinfo_type_info_name<br/>
</a></div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>

View File

@ -51,6 +51,13 @@ boost
</a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/> </a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/>
</a><a href="enable_current_exception.html">enable_current_exception<br/> </a><a href="enable_current_exception.html">enable_current_exception<br/>
</a><a href="enable_error_info.html">enable_error_info<br/> </a><a href="enable_error_info.html">enable_error_info<br/>
</a><a href="errinfo_api_function.html">errinfo_api_function<br/>
</a><a href="errinfo_at_line.html">errinfo_at_line<br/>
</a><a href="errinfo_errno.html">errinfo_errno<br/>
</a><a href="errinfo_file_handle.html">errinfo_file_handle<br/>
</a><a href="errinfo_file_name.html">errinfo_file_name<br/>
</a><a href="errinfo_file_open_mode.html">errinfo_file_open_mode<br/>
</a><a href="errinfo_type_info_name.html">errinfo_type_info_name<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="exception_operator_shl.html">exception/operator&lt;&lt;<br/> </a><a href="exception_operator_shl.html">exception/operator&lt;&lt;<br/>
</a><a href="exception_constructors.html">exception::exception<br/> </a><a href="exception_constructors.html">exception::exception<br/>

View File

@ -53,13 +53,13 @@ catch( ... )
std::cerr &lt;&lt; "OMG!!!"; std::cerr &lt;&lt; "OMG!!!";
}</pre> }</pre>
<p>This is a possible message it may display, the first line is only possible if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> is used:</p> <p>This is a possible message it may display, the first line is only possible if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> is used:</p>
<pre>example_io.cpp(83): Throw in function void parse_file(const char *) <pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class file_open_error Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error std::exception::what: example_io error
[struct tag_errno_code *] = 2, OS says "No such file or directory" [struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct tag_file_name *] = tmp1.xml [struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct tag_function *] = fopen [struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct tag_open_mode *] = rb</pre> [struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
<h3>Why is boost::exception integrated in boost::throw_exception?</h3> <h3>Why is boost::exception integrated in boost::throw_exception?</h3>
<p>The boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::<span class="RenoLink"><a href="exception.html">exception</a></span> as a base of any exception passed to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.</p> <p>The boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::<span class="RenoLink"><a href="exception.html">exception</a></span> as a base of any exception passed to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.</p>
<p>The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and without this they can't use any of the Boost Exception facilities.</p> <p>The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and without this they can't use any of the Boost Exception facilities.</p>

View File

@ -21,11 +21,18 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Headers</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Headers</h2>
</div> </div>
<div class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp<br/>
</a><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp<br/> </a><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp<br/>
</a><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/> </a><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
</a><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/> </a><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/>
</a><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/> </a><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/>
</a><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp<br/>
</a><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp<br/>
</a><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp<br/>
</a><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp<br/>
</a><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp<br/>
</a><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp<br/>
</a><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp<br/>
</a><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp<br/> </a><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp<br/>
</a><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp<br/> </a><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp<br/>
</a><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp<br/> </a><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp<br/>

View File

@ -25,11 +25,18 @@
<div class="RenoIndex"><h3>B</h3> <div class="RenoIndex"><h3>B</h3>
<p><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></p> <p><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></p>
<h3>b</h3> <h3>b</h3>
<p><a href="boost_exception_hpp.html">boost/exception.hpp</a></p> <p><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></p>
<p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p> <p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p>
<p><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p> <p><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p>
<p><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p> <p><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p>
<p><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p> <p><a href="boost_exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p>
<p><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></p>
<p><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></p>
<p><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></p>
<p><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></p>
<p><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></p>
<p><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></p>
<p><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp</a></p>
<p><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></p> <p><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></p>
<p><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></p> <p><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></p>
<p><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></p> <p><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></p>
@ -53,6 +60,13 @@
<h3>e</h3> <h3>e</h3>
<p><a href="enable_current_exception.html">enable_current_exception</a></p> <p><a href="enable_current_exception.html">enable_current_exception</a></p>
<p><a href="enable_error_info.html">enable_error_info</a></p> <p><a href="enable_error_info.html">enable_error_info</a></p>
<p><a href="errinfo_api_function.html">errinfo_api_function</a></p>
<p><a href="errinfo_at_line.html">errinfo_at_line</a></p>
<p><a href="errinfo_errno.html">errinfo_errno</a></p>
<p><a href="errinfo_file_handle.html">errinfo_file_handle</a></p>
<p><a href="errinfo_file_name.html">errinfo_file_name</a></p>
<p><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></p>
<p><a href="errinfo_type_info_name.html">errinfo_type_info_name</a></p>
<p><a href="error_info.html">error_info</a></p> <p><a href="error_info.html">error_info</a></p>
<p><a href="error_info_error_info.html">error_info::error_info</a></p> <p><a href="error_info_error_info.html">error_info::error_info</a></p>
<p><a href="error_info_value.html">error_info::value</a></p> <p><a href="error_info_value.html">error_info::value</a></p>

File diff suppressed because it is too large Load Diff

View File

@ -38,9 +38,9 @@ boost
<span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt; <span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span> class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_function,char const *&gt; throw_function; typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_function_,char const *&gt; throw_function;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_file,char const *&gt; throw_file; typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_file_,char const *&gt; throw_file;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_line,int&gt; throw_line;</span> typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_line_,int&gt; throw_line;</span>
}</span></pre> }</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;</p> <p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">namespace <pre><span class="RenoIncludeSPAN">namespace
@ -172,14 +172,82 @@ boost
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const &amp; e ); void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const &amp; e );
#endif</span> #endif</span>
}</div></span></pre> }</div></span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt;</p> <p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_api_function_,int&gt; <span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_at_line_,int&gt; <span class="RenoLink"><a href="errinfo_at_line.html">errinfo_at_line</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;errno.h&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_errno_,int&gt; <span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
namespace
boost
{
template &lt;class&gt; class weak_ptr;
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_handle_,weak_ptr&lt;FILE&gt; &gt; <span class="RenoLink"><a href="errinfo_file_handle.html">errinfo_file_handle</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_name_,std::string&gt; <span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_file_open_mode_,std::string&gt; <span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct errinfo_type_info_name_,std::string&gt; <span class="RenoLink"><a href="errinfo_type_info_name.html">errinfo_type_info_name</a></span>;</span></span>
}</pre>
</div><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt; <div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="boost_exception_error_info_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="boost_exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</span></pre> #include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_type_info_name_hpp.html">boost/exception/errinfo_type_info_name.hpp</a></span>&gt;</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>

View File

@ -27,7 +27,7 @@
<li>additional platform-specific diagnostic information.</li> <li>additional platform-specific diagnostic information.</li>
</ul></div> </ul></div>
<p>The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:</p> <p>The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;
#include &lt;iostream&gt; #include &lt;iostream&gt;
void f(); //throws unknown types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. void f(); //throws unknown types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.
@ -47,13 +47,13 @@ g()
}</pre> }</pre>
<div class="RenoIncludeDIV"><h4>Example:</h4> <div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p> <p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *) <pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt; Dynamic exception type: class boost::exception_detail::clone_impl&lt;struct fopen_error&gt;
std::exception::what: example_io error std::exception::what: example_io error
[struct tag_errno *] = 2, OS says "No such file or directory" [struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct tag_file_name *] = tmp1.txt [struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct tag_function *] = fopen [struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct tag_open_mode *] = rb</pre> [struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>

View File

@ -22,7 +22,7 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Integrating Boost Exception in Existing Exception Class Hierarchies</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Integrating Boost Exception in Existing Exception Class Hierarchies</h2>
</div> </div>
<p>Some exception hierarchies can not be modified to make boost::<span class="RenoLink"><a href="exception.html">exception</a></span> a base type. In this case, the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function template can be used to make exception objects derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> anyway. Here is an example:</p> <p>Some exception hierarchies can not be modified to make boost::<span class="RenoLink"><a href="exception.html">exception</a></span> a base type. In this case, the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function template can be used to make exception objects derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> anyway. Here is an example:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;
#include &lt;stdexcept&gt; #include &lt;stdexcept&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_std_range_min,size_t&gt; std_range_min; typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_std_range_min,size_t&gt; std_range_min;

View File

@ -28,19 +28,18 @@
</div> </div>
<p>Here is how cloning can be enabled in a throw-expression (15.1):</p> <p>Here is how cloning can be enabled in a throw-expression (15.1):</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;stdio.h&gt; #include &lt;stdio.h&gt;
#include &lt;errno.h&gt; #include &lt;errno.h&gt;
typedef boost::error_info&lt;struct tag_errno,int&gt; errno_info; struct file_read_error: virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
class file_read_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
void void
file_read( FILE * f, void * buffer, size_t size ) file_read( FILE * f, void * buffer, size_t size )
{ {
if( size!=fread(buffer,1,size,f) ) if( size!=fread(buffer,1,size,f) )
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(file_read_error()) &lt;&lt; throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(file_read_error()) &lt;&lt;
errno_info(errno); boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno);
}</pre> }</pre>
<p>Of course, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> may be used with any exception type; there is no requirement that it should derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p> <p>Of course, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> may be used with any exception type; there is no requirement that it should derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Cloning and Re-Throwing an Exception</h3> </div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Cloning and Re-Throwing an Exception</h3>

View File

@ -29,24 +29,22 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3>
</div> </div>
<p>The following example demonstrates how errno can be stored in exception objects using Boost Exception:</p> <p>The following example demonstrates how errno can be stored in exception objects using Boost Exception:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;
#include &lt;errno.h&gt;
#include &lt;iostream&gt; #include &lt;iostream&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; errno_info; //(1) typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_my_info,int&gt; my_info; //(1)
class my_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, public std::exception { }; //(2) struct my_error: virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, virtual std::exception { }; //(2)
void void
f() f()
{ {
throw my_error() &lt;&lt; errno_info(errno); //(3) throw my_error() &lt;&lt; my_info(42); //(3)
} }</pre>
</pre> <p>First, we instantiate the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template using a unique identifier -- tag_my_info, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.</p>
<p>First, we instantiate the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.</p>
<p>Second, we define class my_error, which derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p> <p>Second, we define class my_error, which derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<p>Finally, (3) illustrates how the typedef from (1) can be used with <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> to store values in exception objects at the point of the throw.</p> <p>Finally, (3) illustrates how the typedef from (1) can be used with <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> to store values in exception objects at the point of the throw.</p>
<p>The stored errno value can be recovered at a later time like this:</p> <p>The stored my_info value can be recovered at a later time like this:</p>
<pre>// ...continued <pre>// ...continued
void void
@ -59,8 +57,8 @@ g()
catch( catch(
my_error &amp; x ) my_error &amp; x )
{ {
if( int const * err=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) ) if( int const * mi=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;my_info&gt;(x) )
std::cerr &lt;&lt; "Error code: " &lt;&lt; *err; std::cerr &lt;&lt; "My info: " &lt;&lt; *mi;
} }
}</pre> }</pre>
<p>The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned.</p> <p>The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned.</p>
@ -75,28 +73,25 @@ file_read( FILE * f, void * buffer, size_t size )
}</pre> }</pre>
<p>How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle.</p> <p>How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle.</p>
<p>Using boost::<span class="RenoLink"><a href="exception.html">exception</a></span> allows us to free the file_read function from the burden of storing the file name in exceptions it throws:</p> <p>Using boost::<span class="RenoLink"><a href="exception.html">exception</a></span> allows us to free the file_read function from the burden of storing the file name in exceptions it throws:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;stdio.h&gt; #include &lt;stdio.h&gt;
#include &lt;errno.h&gt; #include &lt;errno.h&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; errno_info; struct file_read_error: virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
class file_read_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
void void
file_read( FILE * f, void * buffer, size_t size ) file_read( FILE * f, void * buffer, size_t size )
{ {
if( size!=fread(buffer,1,size,f) ) if( size!=fread(buffer,1,size,f) )
throw file_read_error() &lt;&lt; errno_info(errno); throw file_read_error() &lt;&lt; boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno);
}</pre> }</pre>
<p>If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally:</p> <p>If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt; #include &lt;boost/shared_ptr.hpp&gt;
#include &lt;stdio.h&gt; #include &lt;stdio.h&gt;
#include &lt;string&gt; #include &lt;string&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_file_name,std::string&gt; file_name_info;
boost::shared_ptr&lt;FILE&gt; file_open( char const * file_name, char const * mode ); boost::shared_ptr&lt;FILE&gt; file_open( char const * file_name, char const * mode );
void file_read( FILE * f, void * buffer, size_t size ); void file_read( FILE * f, void * buffer, size_t size );
@ -113,7 +108,7 @@ parse_file( char const * file_name )
catch( catch(
boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &amp; e ) boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &amp; e )
{ {
e &lt;&lt; file_name_info(file_name); e &lt;&lt; boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(file_name);
throw; throw;
} }
}</pre> }</pre>
@ -122,17 +117,17 @@ parse_file( char const * file_name )
</div> </div>
<p>The code snippet below demonstrates how boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together:</p> <p>The code snippet below demonstrates how boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together:</p>
<pre>#include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="boost_exception_info_tuple_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt; #include &lt;boost/shared_ptr.hpp&gt;
#include &lt;stdio.h&gt; #include &lt;stdio.h&gt;
#include &lt;string&gt; #include &lt;string&gt;
#include &lt;errno.h&gt; #include &lt;errno.h&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_file_name,std::string&gt; file_name_info; typedef boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span>&lt;boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>,boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>&gt; clib_failure;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_function,char const *&gt; function_info;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; errno_info;
typedef boost::tuple&lt;function_info,errno_info&gt; clib_failure;
class file_open_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { }; struct file_open_error: virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
boost::shared_ptr&lt;FILE&gt; boost::shared_ptr&lt;FILE&gt;
file_open( char const * name, char const * mode ) file_open( char const * name, char const * mode )
@ -141,7 +136,7 @@ file_open( char const * name, char const * mode )
return boost::shared_ptr&lt;FILE&gt;(f,fclose); return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else else
throw file_open_error() &lt;&lt; throw file_open_error() &lt;&lt;
file_name_info(name) &lt;&lt; boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>(name) &lt;&lt;
clib_failure("fopen",errno); clib_failure("fopen",errno);
}</pre> }</pre>
<p>Note that the members of a boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> are stored separately in exception objects; they can only be retrieved individually, using <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>.</p> <p>Note that the members of a boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> are stored separately in exception objects; they can only be retrieved individually, using <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>.</p>

View File

@ -22,6 +22,13 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Types</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Types</h2>
</div> </div>
<div class="RenoIndex"><h3>e</h3> <div class="RenoIndex"><h3>e</h3>
<p><a href="errinfo_api_function.html">errinfo_api_function</a></p>
<p><a href="errinfo_at_line.html">errinfo_at_line</a></p>
<p><a href="errinfo_errno.html">errinfo_errno</a></p>
<p><a href="errinfo_file_handle.html">errinfo_file_handle</a></p>
<p><a href="errinfo_file_name.html">errinfo_file_name</a></p>
<p><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></p>
<p><a href="errinfo_type_info_name.html">errinfo_type_info_name</a></p>
<p><a href="error_info.html">error_info</a></p> <p><a href="error_info.html">error_info</a></p>
<p><a href="error_info_value_type.html">error_info::value_type</a></p> <p><a href="error_info_value_type.html">error_info::value_type</a></p>
<p><a href="exception.html">exception</a></p> <p><a href="exception.html">exception</a></p>

View File

@ -13,3 +13,4 @@ obj cloning_2 : cloning_2.cpp : <threading>multi ;
obj info_tuple : info_tuple.cpp ; obj info_tuple : info_tuple.cpp ;
obj enable_error_info : enable_error_info.cpp ; obj enable_error_info : enable_error_info.cpp ;
obj logging : logging.cpp ; obj logging : logging.cpp ;
obj errinfos : errinfos.cpp ;

View File

@ -6,17 +6,16 @@
//This example shows how to enable cloning when throwing a boost::exception. //This example shows how to enable cloning when throwing a boost::exception.
#include <boost/exception/info.hpp> #include <boost/exception/info.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
typedef boost::error_info<struct tag_errno,int> errno_info; struct file_read_error: virtual boost::exception { };
class file_read_error: public boost::exception { };
void void
file_read( FILE * f, void * buffer, size_t size ) file_read( FILE * f, void * buffer, size_t size )
{ {
if( size!=fread(buffer,1,size,f) ) if( size!=fread(buffer,1,size,f) )
throw boost::enable_current_exception(file_read_error()) << throw boost::enable_current_exception(file_read_error()) <<
errno_info(errno); boost::errinfo_errno(errno);
} }

View File

@ -7,7 +7,7 @@
//transporting of arbitrary data to the catch site, even for types //transporting of arbitrary data to the catch site, even for types
//that do not derive from boost::exception. //that do not derive from boost::exception.
#include <boost/exception.hpp> #include <boost/exception/all.hpp>
#include <stdexcept> #include <stdexcept>
typedef boost::error_info<struct tag_std_range_min,size_t> std_range_min; typedef boost::error_info<struct tag_std_range_min,size_t> std_range_min;

53
example/errinfos.cpp Normal file
View File

@ -0,0 +1,53 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//This example demonstrates the intended use of various commonly used
//error_info typedefs provided by Boost Exception.
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_at_line.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_file_handle.hpp>
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_file_open_mode.hpp>
#include <boost/exception/info.hpp>
#include <boost/throw_exception.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <stdio.h>
#include <errno.h>
#include <exception>
struct error : virtual std::exception, virtual boost::exception { };
struct file_error : virtual error { };
struct file_open_error: virtual file_error { };
struct file_read_error: virtual file_error { };
boost::shared_ptr<FILE>
open_file( char const * file, char const * mode )
{
if( FILE * f=fopen(file,mode) )
return boost::shared_ptr<FILE>(f,fclose);
else
BOOST_THROW_EXCEPTION(
file_open_error() <<
boost::errinfo_api_function("fopen") <<
boost::errinfo_errno(errno) <<
boost::errinfo_file_name(file) <<
boost::errinfo_file_open_mode(mode) );
}
size_t
read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size )
{
size_t nr=fread(buf,1,size,f.get());
if( ferror(f.get()) )
BOOST_THROW_EXCEPTION(
file_read_error() <<
boost::errinfo_api_function("fread") <<
boost::errinfo_errno(errno) <<
boost::errinfo_file_handle(f) );
return nr;
}

View File

@ -6,18 +6,17 @@
//This example shows how to add data to boost::exception objects at the //This example shows how to add data to boost::exception objects at the
//point of the throw, and how to retrieve that data at the point of the catch. //point of the throw, and how to retrieve that data at the point of the catch.
#include <boost/exception.hpp> #include <boost/exception/all.hpp>
#include <errno.h>
#include <iostream> #include <iostream>
typedef boost::error_info<struct tag_errno,int> errno_info; //(1) typedef boost::error_info<struct tag_my_info,int> my_info; //(1)
class my_error: public boost::exception, public std::exception { }; //(2) struct my_error: virtual boost::exception, virtual std::exception { }; //(2)
void void
f() f()
{ {
throw my_error() << errno_info(errno); //(3) throw my_error() << my_info(42); //(3)
} }
void void
@ -30,7 +29,7 @@ g()
catch( catch(
my_error & x ) my_error & x )
{ {
if( int const * err=boost::get_error_info<errno_info>(x) ) if( int const * mi=boost::get_error_info<my_info>(x) )
std::cerr << "Error code: " << *err; std::cerr << "My info: " << *mi;
} }
} }

View File

@ -5,28 +5,24 @@
//This example shows how to add arbitrary data to active exception objects. //This example shows how to add arbitrary data to active exception objects.
#include <boost/exception.hpp> #include <boost/exception/all.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
// //
typedef boost::error_info<struct tag_errno,int> errno_info; struct file_read_error: virtual boost::exception { };
class file_read_error: public boost::exception { };
void void
file_read( FILE * f, void * buffer, size_t size ) file_read( FILE * f, void * buffer, size_t size )
{ {
if( size!=fread(buffer,1,size,f) ) if( size!=fread(buffer,1,size,f) )
throw file_read_error() << errno_info(errno); throw file_read_error() << boost::errinfo_errno(errno);
} }
// //
typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
void file_read( FILE * f, void * buffer, size_t size ); void file_read( FILE * f, void * buffer, size_t size );
@ -43,7 +39,7 @@ parse_file( char const * file_name )
catch( catch(
boost::exception & e ) boost::exception & e )
{ {
e << file_name_info(file_name); e << boost::errinfo_file_name(file_name);
throw; throw;
} }
} }

View File

@ -3,48 +3,34 @@
//Distributed under the Boost Software License, Version 1.0. (See accompanying //Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//This program simulates errors on copying simple data files. //This program simulates errors on copying simple data files. It demonstrates
//It demonstrates how the proposed Boost exception library can be used. //typical Boost Exception usage.
//
//The documentation for boost::exception can be found at:
//
// http://www.revergestudios.com/boost-exception/boost-exception.htm.
//
//The output from this program can vary depending on the compiler/OS combination.
#include <boost/exception.hpp> //The output from this program can vary depending on the platform.
#include <boost/throw_exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/errinfo_file_open_mode.hpp>
#include <boost/exception/errinfo_file_handle.hpp>
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <stdio.h>
#include <errno.h>
#include <string>
#include <iostream> #include <iostream>
#include <sstream>
typedef boost::error_info<struct tag_errno,int> errno_info; typedef boost::error_info<struct tag_file_name_src,std::string> errinfo_src_file_name;
typedef boost::error_info<struct tag_file_stream,boost::weak_ptr<FILE> > file_stream_info; typedef boost::error_info<struct tag_file_name_dst,std::string> errinfo_dst_file_name;
typedef boost::error_info<struct tag_open_mode,std::string> open_mode_info; //The open mode of a failed fopen request.
typedef boost::error_info<struct tag_file_name,std::string> file_name_info; //The file name of a failed file operation.
typedef boost::error_info<struct tag_file_name_src,std::string> file_name_src_info; //The source file name of a failed copy operation.
typedef boost::error_info<struct tag_file_name_dst,std::string> file_name_dst_info; //The destination file name of a failed copy operation.
typedef boost::error_info<struct tag_function,std::string> function_info; //The name of the C function which reported the failure.
std::string
to_string( errno_info const & e )
{
int en=e.value();
std::ostringstream s;
s << en << ", OS says \"" << strerror(en) << "\"";
return s.str();
}
char const data[] = "example"; char const data[] = "example";
size_t const data_size = sizeof(data); size_t const data_size = sizeof(data);
class class
error: //Base for all exception objects we throw. error: //Base for all exception objects we throw.
public std::exception, public virtual std::exception,
public boost::exception public virtual boost::exception
{ {
public: public:
@ -61,14 +47,12 @@ error: //Base for all exception objects we throw.
} }
}; };
class open_error: public error { }; struct open_error: virtual error { };
class read_error: public error { }; struct read_error: virtual error { };
class write_error: public error { }; struct write_error: virtual error { };
struct fopen_error: virtual open_error { };
class fopen_error: public open_error { }; struct fread_error: virtual read_error { };
class fread_error: public read_error { }; struct fwrite_error: virtual write_error { };
class fwrite_error: public write_error { };
boost::shared_ptr<FILE> boost::shared_ptr<FILE>
my_fopen( char const * name, char const * mode ) my_fopen( char const * name, char const * mode )
@ -77,10 +61,10 @@ my_fopen( char const * name, char const * mode )
return boost::shared_ptr<FILE>(f,fclose); return boost::shared_ptr<FILE>(f,fclose);
else else
BOOST_THROW_EXCEPTION(fopen_error() << BOOST_THROW_EXCEPTION(fopen_error() <<
errno_info(errno) << boost::errinfo_errno (errno) <<
file_name_info(name) << boost::errinfo_file_name(name) <<
open_mode_info(mode) << boost::errinfo_file_open_mode(mode) <<
function_info("fopen")); boost::errinfo_api_function("fopen"));
} }
void void
@ -89,9 +73,9 @@ my_fread( void * buffer, size_t size, size_t count, boost::shared_ptr<FILE> cons
assert(stream); assert(stream);
if( count!=fread(buffer,size,count,stream.get()) || ferror(stream.get()) ) if( count!=fread(buffer,size,count,stream.get()) || ferror(stream.get()) )
BOOST_THROW_EXCEPTION(fread_error() << BOOST_THROW_EXCEPTION(fread_error() <<
function_info("fread") << boost::errinfo_api_function("fread") <<
errno_info(errno) << boost::errinfo_errno(errno) <<
file_stream_info(boost::weak_ptr<FILE>(stream))); boost::errinfo_file_handle(boost::weak_ptr<FILE>(stream)));
} }
void void
@ -100,9 +84,9 @@ my_fwrite( void const * buffer, size_t size, size_t count, boost::shared_ptr<FIL
assert(stream); assert(stream);
if( count!=fwrite(buffer,size,count,stream.get()) || ferror(stream.get()) ) if( count!=fwrite(buffer,size,count,stream.get()) || ferror(stream.get()) )
BOOST_THROW_EXCEPTION(fwrite_error() << BOOST_THROW_EXCEPTION(fwrite_error() <<
function_info("fwrite") << boost::errinfo_api_function("fwrite") <<
errno_info(errno) << boost::errinfo_errno(errno) <<
file_stream_info(boost::weak_ptr<FILE>(stream))); boost::errinfo_file_handle(boost::weak_ptr<FILE>(stream)));
} }
void void
@ -132,17 +116,17 @@ copy_data( char const * src_file_name, char const * dst_file_name )
catch( catch(
boost::exception & x ) boost::exception & x )
{ {
if( boost::weak_ptr<FILE> const * f=boost::get_error_info<file_stream_info>(x) ) if( boost::weak_ptr<FILE> const * f=boost::get_error_info<boost::errinfo_file_handle>(x) )
if( boost::shared_ptr<FILE> fs = f->lock() ) if( boost::shared_ptr<FILE> fs = f->lock() )
{ {
if( fs==src ) if( fs==src )
x << file_name_info(src_file_name); x << boost::errinfo_file_name(src_file_name);
else if( fs==dst ) else if( fs==dst )
x << file_name_info(dst_file_name); x << boost::errinfo_file_name(dst_file_name);
} }
x << x <<
file_name_src_info(src_file_name) << errinfo_src_file_name(src_file_name) <<
file_name_dst_info(dst_file_name); errinfo_dst_file_name(dst_file_name);
throw; throw;
} }
} }
@ -150,25 +134,25 @@ copy_data( char const * src_file_name, char const * dst_file_name )
void void
dump_copy_info( boost::exception const & x ) dump_copy_info( boost::exception const & x )
{ {
if( std::string const * src = boost::get_error_info<file_name_src_info>(x) ) if( std::string const * src = boost::get_error_info<errinfo_src_file_name>(x) )
std::cerr << "Source file name: " << *src << "\n"; std::cerr << "Source file name: " << *src << "\n";
if( std::string const * dst = boost::get_error_info<file_name_dst_info>(x) ) if( std::string const * dst = boost::get_error_info<errinfo_dst_file_name>(x) )
std::cerr << "Destination file name: " << *dst << "\n"; std::cerr << "Destination file name: " << *dst << "\n";
} }
void void
dump_file_info( boost::exception const & x ) dump_file_info( boost::exception const & x )
{ {
if( std::string const * fn = boost::get_error_info<file_name_info>(x) ) if( std::string const * fn = boost::get_error_info<boost::errinfo_file_name>(x) )
std::cerr << "File name: " << *fn << "\n"; std::cerr << "File name: " << *fn << "\n";
} }
void void
dump_clib_info( boost::exception const & x ) dump_clib_info( boost::exception const & x )
{ {
if( int const * err=boost::get_error_info<errno_info>(x) ) if( int const * err=boost::get_error_info<boost::errinfo_errno>(x) )
std::cerr << "OS error: " << *err << "\n"; std::cerr << "OS error: " << *err << "\n";
if( std::string const * fn=boost::get_error_info<function_info>(x) ) if( char const * const * fn=boost::get_error_info<boost::errinfo_api_function>(x) )
std::cerr << "Failed function: " << *fn << "\n"; std::cerr << "Failed function: " << *fn << "\n";
} }

View File

@ -3,21 +3,21 @@
//Distributed under the Boost Software License, Version 1.0. (See accompanying //Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//This example shows how boost::error_info_group can be used to bundle //This example shows how boost::tuple can be used to bundle the
//the name of the function that fails together with the reported errno. //name of the function that fails together with the reported errno.
#include <boost/exception/info_tuple.hpp> #include <boost/exception/info_tuple.hpp>
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <errno.h> #include <errno.h>
typedef boost::error_info<struct tag_file_name,std::string> file_name_info; typedef boost::tuple<boost::errinfo_api_function,boost::errinfo_errno> clib_failure;
typedef boost::error_info<struct tag_function,char const *> function_info;
typedef boost::error_info<struct tag_errno,int> errno_info;
typedef boost::tuple<function_info,errno_info> clib_failure;
class file_open_error: public boost::exception { }; struct file_open_error: virtual boost::exception { };
boost::shared_ptr<FILE> boost::shared_ptr<FILE>
file_open( char const * name, char const * mode ) file_open( char const * name, char const * mode )
@ -26,6 +26,6 @@ file_open( char const * name, char const * mode )
return boost::shared_ptr<FILE>(f,fclose); return boost::shared_ptr<FILE>(f,fclose);
else else
throw file_open_error() << throw file_open_error() <<
file_name_info(name) << boost::errinfo_file_name(name) <<
clib_failure("fopen",errno); clib_failure("fopen",errno);
} }

View File

@ -3,9 +3,9 @@
//Distributed under the Boost Software License, Version 1.0. (See accompanying //Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//This example shows to print all data contained in a boost::exception. //This example shows how to print all data contained in a boost::exception.
#include <boost/exception.hpp> #include <boost/exception/all.hpp>
#include <iostream> #include <iostream>
void f(); //throws unknown types that derive from boost::exception. void f(); //throws unknown types that derive from boost::exception.

View File

@ -0,0 +1,26 @@
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/error_info.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/info_tuple.hpp>
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_at_line.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_file_handle.hpp>
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_file_open_mode.hpp>
#include <boost/exception/errinfo_type_info_name.hpp>
#ifndef BOOST_NO_EXCEPTIONS
#include <boost/exception_ptr.hpp>
#endif
#endif

View File

@ -0,0 +1,22 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_DDFBB4546C1211DEA4659E9055D89593
#define UUID_DDFBB4546C1211DEA4659E9055D89593
#include "boost/exception/error_info.hpp"
namespace
boost
{
//Usage hint:
//if( api_function(....)!=0 )
// BOOST_THROW_EXCEPTION(
// failure() <<
// errinfo_api_function("api_function") );
typedef error_info<struct errinfo_api_function_,char const *> errinfo_api_function;
}
#endif

View File

@ -0,0 +1,18 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_E7255CE26C1211DE85800C9155D89593
#define UUID_E7255CE26C1211DE85800C9155D89593
namespace
boost
{
template <class Tag,class T> class error_info;
//Use with parsing errors exceptions, for example in a XML file parser.
typedef error_info<struct errinfo_at_line_,int> errinfo_at_line;
}
#endif

View File

@ -0,0 +1,35 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
#define UUID_F0EE17BE6C1211DE87FF459155D89593
#include "boost/exception/info.hpp"
#include <errno.h>
#include <string.h>
namespace
boost
{
typedef error_info<struct errinfo_errno_,int> errinfo_errno;
//Usage hint:
//if( c_function(....)!=0 )
// BOOST_THROW_EXCEPTION(
// failure() <<
// errinfo_errno(errno) <<
// errinfo_api_function("c_function") );
inline
std::string
to_string( errinfo_errno const & e )
{
std::ostringstream tmp;
int v=e.value();
tmp << v << ", \"" << strerror(v) << "\"";
return tmp.str();
}
}
#endif

View File

@ -0,0 +1,20 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_F79E6EE26C1211DEB26E929155D89593
#define UUID_F79E6EE26C1211DEB26E929155D89593
#include <stdio.h>
namespace
boost
{
template <class> class weak_ptr;
template <class Tag,class T> class error_info;
typedef error_info<struct errinfo_file_handle_,weak_ptr<FILE> > errinfo_file_handle;
}
#endif

View File

@ -0,0 +1,26 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_FEE5120A6C1211DE94E8BC9155D89593
#define UUID_FEE5120A6C1211DE94E8BC9155D89593
#include <string>
namespace
boost
{
template <class Tag,class T> class error_info;
//Usage hint:
//FILE * f=fopen(name,mode);
//if( !f )
// BOOST_THROW_EXCEPTION(
// file_open_error() <<
// errinfo_file_name(name) <<
// errinfo_file_open_mode(mode) );
typedef error_info<struct errinfo_file_name_,std::string> errinfo_file_name;
}
#endif

View File

@ -0,0 +1,26 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_056F1F266C1311DE8E74299255D89593
#define UUID_056F1F266C1311DE8E74299255D89593
#include <string>
namespace
boost
{
template <class Tag,class T> class error_info;
//Usage hint:
//FILE * f=fopen(name,mode);
//if( !f )
// BOOST_THROW_EXCEPTION(
// file_open_error() <<
// errinfo_file_name(name) <<
// errinfo_file_open_mode(mode) );
typedef error_info<struct errinfo_file_open_mode_,std::string> errinfo_file_open_mode;
}
#endif

View File

@ -0,0 +1,23 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_0E11109E6C1311DEB7EA649255D89593
#define UUID_0E11109E6C1311DEB7EA649255D89593
#include <string>
namespace
boost
{
template <class Tag,class T> class error_info;
//Usage hint:
//BOOST_THROW_EXCEPTION(
// bad_type() <<
// errinfo_type_info_name(typeid(x).name()) );
typedef error_info<struct errinfo_type_info_name_,std::string> errinfo_type_info_name;
}
#endif

View File

@ -80,13 +80,13 @@ boost
template <class Tag,class T> template <class Tag,class T>
class error_info; class error_info;
typedef error_info<struct tag_throw_function,char const *> throw_function; typedef error_info<struct throw_function_,char const *> throw_function;
typedef error_info<struct tag_throw_file,char const *> throw_file; typedef error_info<struct throw_file_,char const *> throw_file;
typedef error_info<struct tag_throw_line,int> throw_line; typedef error_info<struct throw_line_,int> throw_line;
template <> template <>
class class
error_info<tag_throw_function,char const *> error_info<throw_function_,char const *>
{ {
public: public:
typedef char const * value_type; typedef char const * value_type;
@ -100,7 +100,7 @@ boost
template <> template <>
class class
error_info<tag_throw_file,char const *> error_info<throw_file_,char const *>
{ {
public: public:
typedef char const * value_type; typedef char const * value_type;
@ -114,7 +114,7 @@ boost
template <> template <>
class class
error_info<tag_throw_line,int> error_info<throw_line_,int>
{ {
public: public:
typedef int value_type; typedef int value_type;

View File

@ -35,6 +35,7 @@ run diagnostic_information_test.cpp ;
run refcount_ptr_test.cpp ; run refcount_ptr_test.cpp ;
run current_exception_cast_test.cpp ; run current_exception_cast_test.cpp ;
run no_exceptions_test.cpp : : : <exception-handling>off ; run no_exceptions_test.cpp : : : <exception-handling>off ;
run errinfos_test.cpp ;
compile-fail exception_fail.cpp ; compile-fail exception_fail.cpp ;
compile-fail throw_exception_fail.cpp ; compile-fail throw_exception_fail.cpp ;
@ -49,4 +50,12 @@ compile info_hpp_test.cpp ;
compile info_tuple_hpp_test.cpp ; compile info_tuple_hpp_test.cpp ;
compile to_string_hpp_test.cpp ; compile to_string_hpp_test.cpp ;
compile to_string_stub_hpp_test.cpp ; compile to_string_stub_hpp_test.cpp ;
compile all_hpp_test.cpp ;
compile current_exception_cast_hpp_test.cpp ; compile current_exception_cast_hpp_test.cpp ;
compile errinfo_api_function_hpp_test.cpp ;
compile errinfo_at_line_hpp_test.cpp ;
compile errinfo_errno_hpp_test.cpp ;
compile errinfo_file_handle_hpp_test.cpp ;
compile errinfo_file_name_hpp_test.cpp ;
compile errinfo_file_open_mode_hpp_test.cpp ;
compile errinfo_type_info_name_hpp_test.cpp ;

7
test/all_hpp_test.cpp Normal file
View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/all.hpp>
#include <boost/exception/all.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_api_function.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_at_line.hpp>
#include <boost/exception/errinfo_at_line.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_errno.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_file_handle.hpp>
#include <boost/exception/errinfo_file_handle.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_file_name.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_file_open_mode.hpp>
#include <boost/exception/errinfo_file_open_mode.hpp>

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_type_info_name.hpp>
#include <boost/exception/errinfo_type_info_name.hpp>

61
test/errinfos_test.cpp Normal file
View File

@ -0,0 +1,61 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_at_line.hpp>
#include <boost/exception/errinfo_errno.hpp>
#include <boost/exception/errinfo_file_handle.hpp>
#include <boost/exception/errinfo_file_name.hpp>
#include <boost/exception/errinfo_file_open_mode.hpp>
#include <boost/exception/errinfo_type_info_name.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/throw_exception.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <exception>
struct
test_exception:
virtual boost::exception,
virtual std::exception
{
};
int
main()
{
using namespace boost;
try
{
BOOST_THROW_EXCEPTION(
test_exception() <<
errinfo_api_function("failed_api_function") <<
errinfo_at_line(42) <<
errinfo_errno(errno) <<
errinfo_file_handle(weak_ptr<FILE>()) <<
errinfo_file_name("filename.txt") <<
errinfo_file_open_mode("rb") <<
errinfo_type_info_name(typeid(int).name()) );
BOOST_TEST(false);
}
catch(
boost::exception & e )
{
BOOST_TEST(get_error_info<errinfo_api_function>(e) && *get_error_info<errinfo_api_function>(e)==std::string("failed_api_function"));
BOOST_TEST(get_error_info<errinfo_at_line>(e) && *get_error_info<errinfo_at_line>(e)==42);
BOOST_TEST(get_error_info<errinfo_errno>(e) && *get_error_info<errinfo_errno>(e)==0);
BOOST_TEST(get_error_info<errinfo_file_handle>(e) && get_error_info<errinfo_file_handle>(e)->expired());
BOOST_TEST(get_error_info<errinfo_file_name>(e) && *get_error_info<errinfo_file_name>(e)=="filename.txt");
BOOST_TEST(get_error_info<errinfo_file_open_mode>(e) && *get_error_info<errinfo_file_open_mode>(e)=="rb");
BOOST_TEST(get_error_info<errinfo_type_info_name>(e) && *get_error_info<errinfo_type_info_name>(e)==typeid(int).name());
}
catch(
... )
{
BOOST_TEST(false);
}
return boost::report_errors();
}