3 // Copyright (C) 2006 Stefan Bund <g0dil@senf.berlios.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the
17 // Free Software Foundation, Inc.,
18 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 \brief Exception inline non-template implementation */
27 #define prefix_ inline
28 ///////////////////////////////cci.p///////////////////////////////////////
30 prefix_ senf::SystemException::SystemException()
31 : where_(0), code_(errno)
36 prefix_ senf::SystemException::SystemException(int code)
37 : where_(0), code_(code)
42 prefix_ senf::SystemException::SystemException(char const * where)
43 : where_(where), code_(errno)
48 prefix_ senf::SystemException::SystemException(char const * where, int code)
49 : where_(where), code_(code)
54 prefix_ char const * senf::SystemException::what()
57 return buffer_.c_str();
60 prefix_ char const * senf::SystemException::where()
66 prefix_ int senf::SystemException::code()
72 prefix_ char const * senf::SystemException::description()
75 return std::strerror(code_);
78 prefix_ bool senf::SystemException::anyOf(int c0, int c1, int c2, int c3, int c4, int c5,
79 int c6, int c7, int c8, int c9)
82 (c0 && code_ == c0) ||
83 (c1 && code_ == c1) ||
84 (c2 && code_ == c2) ||
85 (c3 && code_ == c3) ||
86 (c4 && code_ == c4) ||
87 (c5 && code_ == c5) ||
88 (c6 && code_ == c6) ||
89 (c7 && code_ == c7) ||
90 (c8 && code_ == c8) ||
94 prefix_ senf::SystemException::~SystemException()
98 prefix_ void senf::throwErrno()
100 throwErrno(0, errno);
103 prefix_ void senf::throwErrno(char const * where)
105 throwErrno(where, errno);
108 prefix_ void senf::throwErrno(int code)
113 ///////////////////////////////cci.e///////////////////////////////////////
120 // c-file-style: "senf"
121 // indent-tabs-mode: nil
122 // ispell-local-dictionary: "american"
123 // compile-command: "scons -u test"
124 // comment-column: 40