X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmException.cxx;h=375820b4212e5268bec553cff968c014b95b7763;hb=c132b43ebda61490fe85f62a88969b6cfb9e400d;hp=f51f6e4c787253f03401efada3dbaaf25e8918f1;hpb=b6969c4d25a055bedc387044058beb1e4c36ee80;p=gdcm.git diff --git a/src/gdcmException.cxx b/src/gdcmException.cxx index f51f6e4c..375820b4 100644 --- a/src/gdcmException.cxx +++ b/src/gdcmException.cxx @@ -3,12 +3,12 @@ Program: gdcm Module: $RCSfile: gdcmException.cxx,v $ Language: C++ - Date: $Date: 2004/08/16 04:25:18 $ - Version: $Revision: 1.17 $ + Date: $Date: 2004/10/12 04:35:46 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details. + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR @@ -19,18 +19,19 @@ #include "gdcmException.h" #include -#include +namespace gdcm +{ //----------------------------------------------------------------------------- -// gdcmException +// Exception /** - * \ingroup gdcmException + * \ingroup Exception * \brief constructor * @param f * @param msg */ -gdcmException::gdcmException(const std::string &f, const std::string& msg) throw() +Exception::Exception(const std::string &f, const std::string& msg) throw() #ifdef __GNUC__ try #endif @@ -38,17 +39,17 @@ gdcmException::gdcmException(const std::string &f, const std::string& msg) throw } #ifdef __GNUC__ catch(...) { - fatal("gdcmException::gdcmException(const std::string&, const std::string&, const std::string&)"); + fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)"); } #endif /** - * \ingroup gdcmException + * \ingroup Exception * \brief fatal * @param from */ -void gdcmException::fatal(const char *from) throw() { +void Exception::fatal(const char *from) throw() { try { std::cerr << "Fatal: exception received in " << from @@ -71,11 +72,11 @@ void gdcmException::fatal(const char *from) throw() { } /** - * \ingroup gdcmException + * \ingroup Exception * \brief getName * @return string */ -std::string gdcmException::getName() const throw() +std::string Exception::getName() const throw() { try { @@ -111,26 +112,26 @@ std::string gdcmException::getName() const throw() } /** - * \ingroup gdcmException - * \brief gdcmException + * \ingroup Exception + * \brief Exception */ - gdcmException::operator const char *() const throw() { + Exception::operator const char *() const throw() { return getName().c_str(); } //----------------------------------------------------------------------------- /** - * \ingroup gdcmException - * \brief gdcmException::operator << + * \ingroup Exception + * \brief Exception::operator << */ - std::ostream& operator<<(std::ostream &os, const gdcmException &e) { + std::ostream& operator<<(std::ostream &os, const Exception &e) { try { os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl; } catch(...) { - gdcmException::fatal("operator<<(std::ostream &, const gdcmException&)"); + Exception::fatal("operator<<(std::ostream &, const Exception&)"); } return os; } - +} // end namespace gdcm //-----------------------------------------------------------------------------