X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmException.h;h=250fb60533a19b1e020f4e1520788d0f329e1d2c;hb=b8a5842638a6d29023d5440c09b08c94b0cbcc75;hp=2378e3b8ff254f872ab72c8b0d0c24398343166c;hpb=724fc941e10045f4e21ac6bdd7d8e89c3b68bbf9;p=gdcm.git diff --git a/src/gdcmException.h b/src/gdcmException.h index 2378e3b8..250fb605 100644 --- a/src/gdcmException.h +++ b/src/gdcmException.h @@ -18,13 +18,7 @@ #include #include #include -using namespace std; - -#ifdef _MSC_VER -#define GDCM_EXPORT __declspec( dllexport ) -#else -#define GDCM_EXPORT -#endif +#include "gdcmCommon.h" /** * Any exception thrown in the gdcm library @@ -32,9 +26,9 @@ using namespace std; class GDCM_EXPORT gdcmException : public exception { protected: /// error message - string from; + std::string from; /// error message - string error; + std::string error; public: /** @@ -44,7 +38,7 @@ class GDCM_EXPORT gdcmException : public exception { * @param from name of the thrower * @param error error description string */ - explicit gdcmException(const string &from, const string &error = "") + explicit gdcmException(const std::string &from, const std::string &error = "") throw(); @@ -55,7 +49,7 @@ class GDCM_EXPORT gdcmException : public exception { } /// returns error message - const string &getError(void) const throw() { + const std::string &getError(void) const throw() { return error; } @@ -72,9 +66,9 @@ class GDCM_EXPORT gdcmException : public exception { static void fatal(const char *from) throw(); /// try to discover this (dynamic) class name - virtual string getName() const throw(); + virtual std::string getName() const throw(); - friend ostream& operator<<(ostream &os, const gdcmException &e); + friend std::ostream& operator<<(std::ostream &os, const gdcmException &e); }; @@ -84,7 +78,7 @@ class GDCM_EXPORT gdcmException : public exception { * @param e exception to print * @returns output stream os */ -ostream& operator<<(ostream &os, const gdcmException &e); +std::ostream& operator<<(std::ostream &os, const gdcmException &e); /** @@ -99,15 +93,13 @@ class GDCM_EXPORT gdcmFileError : public gdcmException { * @param from name of the thrower * @param error error description string */ - explicit gdcmFileError(const string &from, - const string &error = "File error") + explicit gdcmFileError(const std::string &from, + const std::string &error = "File error") throw() : gdcmException(from, error) { } }; - - /** * Invalid file format exception */ @@ -120,8 +112,8 @@ class GDCM_EXPORT gdcmFormatError : public gdcmException { * @param from name of the thrower * @param error error description string */ - explicit gdcmFormatError(const string &from, - const string &error = "Invalid file format error") + explicit gdcmFormatError(const std::string &from, + const std::string &error = "Invalid file format error") throw() : gdcmException(from, error) { } };