1 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML
1.0 Strict//EN'
2 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
>
3 <html xmlns='http://www.w3.org/
1999/xhtml' xml:lang='en' lang='en'
>
5 <meta http-equiv='Content-Type' content='text/html; charset=utf-
8'
/>
6 <title>errinfo_at_line
</title>
7 <link href='reno.css' type='text/css' rel='stylesheet'
/>
15 <a href=
"http://www.boost.org"><img style=
"border:0" src=
"../../../boost.png" alt=
"Boost" width=
"277" height=
"86"/></a>
17 <h1>Boost Exception
</h1>
19 <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
20 <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
21 <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
22 <div class=
"RenoIncludeDIV"><div class=
"RenoAutoDIV"><h3>errinfo_at_line
</h3>
24 <div class=
"RenoIncludeDIV"><p><span class=
"RenoEscape">#<!--<wiki>`#</wiki>--></span>include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp
</a></span>></p>
25 <div class=
"RenoIncludeDIV"><pre>#include
<<span class=
"RenoLink"><a href=
"boost_exception_error_info_hpp.html">boost/exception/error_info.hpp
</a></span>>
30 <span class=
"RenoIncludeSPAN"> <span class=
"RenoIncludeSPAN">typedef
<span class=
"RenoLink"><a href=
"error_info.html">error_info
</a></span><struct errinfo_at_line_,int
> <span class=
"RenoLink">errinfo_at_line
</span>;
</span></span>
32 </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>
34 <div class=
"RenoIncludeDIV"><pre>#include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_api_function_hpp.html">boost/exception/errinfo_api_function.hpp
</a></span>>
35 #include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp
</a></span>>
36 #include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp
</a></span>>
37 #include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_file_handle_hpp.html">boost/exception/errinfo_file_handle.hpp
</a></span>>
38 #include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_file_name_hpp.html">boost/exception/errinfo_file_name.hpp
</a></span>>
39 #include
<<span class=
"RenoLink"><a href=
"boost_exception_errinfo_file_open_mode_hpp.html">boost/exception/errinfo_file_open_mode.hpp
</a></span>>
40 #include
<<span class=
"RenoLink"><a href=
"boost_exception_info_hpp.html">boost/exception/info.hpp
</a></span>>
41 #include
<<span class=
"RenoLink"><a href=
"boost_throw_exception_hpp.html">boost/throw_exception.hpp
</a></span>>
42 #include
<boost/shared_ptr.hpp
>
43 #include
<boost/weak_ptr.hpp
>
44 #include
<stdio.h
>
45 #include
<errno.h
>
46 #include
<exception
>
48 struct error : virtual std::exception, virtual boost::
<span class=
"RenoLink"><a href=
"exception.html">exception
</a></span> { };
49 struct file_error : virtual error { };
50 struct file_open_error: virtual file_error { };
51 struct file_read_error: virtual file_error { };
53 boost::shared_ptr
<FILE
>
54 open_file( char const * file, char const * mode )
56 if( FILE * f=fopen(file,mode) )
57 return boost::shared_ptr
<FILE
>(f,fclose);
59 <span class=
"RenoLink"><a href=
"BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION
</a></span>(
60 file_open_error()
<<
61 boost::
<span class=
"RenoLink"><a href=
"errinfo_api_function.html">errinfo_api_function
</a></span>(
"fopen")
<<
62 boost::
<span class=
"RenoLink"><a href=
"errinfo_errno.html">errinfo_errno
</a></span>(errno)
<<
63 boost::
<span class=
"RenoLink"><a href=
"errinfo_file_name.html">errinfo_file_name
</a></span>(file)
<<
64 boost::
<span class=
"RenoLink"><a href=
"errinfo_file_open_mode.html">errinfo_file_open_mode
</a></span>(mode) );
68 read_file( boost::shared_ptr
<FILE
> const
& f, void * buf, size_t size )
70 size_t nr=fread(buf,
1,size,f.get());
72 <span class=
"RenoLink"><a href=
"BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION
</a></span>(
73 file_read_error()
<<
74 boost::
<span class=
"RenoLink"><a href=
"errinfo_api_function.html">errinfo_api_function
</a></span>(
"fread")
<<
75 boost::
<span class=
"RenoLink"><a href=
"errinfo_errno.html">errinfo_errno
</a></span>(errno)
<<
76 boost::
<span class=
"RenoLink"><a href=
"errinfo_file_handle.html">errinfo_file_handle
</a></span>(f) );
79 </div></div><div class=
"RenoAutoDIV"><div class=
"RenoHR"><hr/></div>
80 See also:
<span class=
"RenoPageList"><a href=
"boost_exception_errinfo_at_line_hpp.html">boost/exception/errinfo_at_line.hpp
</a></span>
82 <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
83 <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
84 <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
87 <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>
88 <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>
89 <small>Copyright (c)
2006-
2009 by Emil Dotchevski and Reverge Studios, Inc.
<br/>
90 Distributed under the
<a href=
"http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version
1.0</a>.
</small>