]> git.lyx.org Git - lyx.git/blob - boost/boost/exception/errinfo_errno.hpp
Don't need this.
[lyx.git] / boost / boost / exception / errinfo_errno.hpp
1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
2 \r
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying\r
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
5 \r
6 #ifndef UUID_F0EE17BE6C1211DE87FF459155D89593\r
7 #define UUID_F0EE17BE6C1211DE87FF459155D89593\r
8 \r
9 #include "boost/exception/info.hpp"\r
10 #include <errno.h>\r
11 #include <string.h>\r
12 \r
13 namespace\r
14 boost\r
15     {\r
16     typedef error_info<struct errinfo_errno_,int> errinfo_errno;\r
17 \r
18     //Usage hint:\r
19     //if( c_function(....)!=0 )\r
20     //    BOOST_THROW_EXCEPTION(\r
21     //        failure() <<\r
22     //        errinfo_errno(errno) <<\r
23     //        errinfo_api_function("c_function") );\r
24     inline\r
25     std::string\r
26     to_string( errinfo_errno const & e )\r
27         {\r
28         std::ostringstream tmp;\r
29         int v=e.value();\r
30         tmp << v << ", \"" << strerror(v) << "\"";\r
31         return tmp.str();\r
32         }\r
33     }\r
34 \r
35 #endif\r