X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cc;h=28073e67e91a3704fdc941959adfda32676fc620;hb=fe593b5092295224c1f4334bcc97801d2cf41b89;hp=c9a43f111f6ca8748406f9b7dfdc66af580286a9;hpb=c28e0df3accaafcc9a934275f80c80153f5a0e54;p=senf.git diff --git a/Utils/Exception.cc b/Utils/Exception.cc index c9a43f1..28073e6 100644 --- a/Utils/Exception.cc +++ b/Utils/Exception.cc @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Copyright (C) 2006 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,31 +20,39 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of non-inline non-template functions +/** \file + \brief Exception non-inline non-template implementation */ #include "Exception.hh" //#include "Exception.ih" // Custom includes -#include -#include #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void satcom::lib::SystemException::init() +/////////////////////////////////////////////////////////////////////////// +// senf::Exception + +prefix_ senf::Exception::~Exception() + throw() +{} + +prefix_ char const * senf::Exception::what() + const throw() { - std::stringstream s; - if (where) - s << where << ": "; - s << "(" << err << ") " << std::strerror(err); - buffer_ = s.str(); + return message_.c_str(); } -prefix_ char const * satcom::lib::SystemException::what() - const throw() +/////////////////////////////////////////////////////////////////////////// +// senf::SystemException + +prefix_ void senf::SystemException::init(std::string const & where, int code) { - return buffer_.c_str(); + code_ = code; + if (! where.empty()) + (*this) << where << ": "; + (*this) << "(" << code << ") " << description(); } ///////////////////////////////cc.e//////////////////////////////////////// @@ -53,5 +61,10 @@ prefix_ char const * satcom::lib::SystemException::what() // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: