summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Exception.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2006-03-30 18:06:58 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2006-03-30 18:06:58 (GMT)
commita7e993d72be8fed2f0d63a8169e185bb2a298842 (patch)
tree420d7ea5ab1fd6415710f5f623f9667721f3f78e /c++/src/H5Exception.h
parent5a90c6b31c8904a407bb91ee4cc6a7aeecf73bed (diff)
downloadhdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.zip
hdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.tar.gz
hdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.tar.bz2
[svn-r12180] Purpose: Maintenance
Description: Added alias H5_std so either the global or std namespace can be used, depending on H5_NO_STD. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) AIX 5.1 (copper)
Diffstat (limited to 'c++/src/H5Exception.h')
-rw-r--r--c++/src/H5Exception.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 591fcab..7d9817f 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -20,29 +20,31 @@
#ifndef H5_NO_NAMESPACE
namespace H5 {
-#ifndef H5_NO_STD
- using std::string;
-#endif // H5_NO_STD
+#ifdef H5_NO_STD
+ namespace H5_std =;
+#else
+ namespace H5_std = std;
+#endif
#endif
class H5_DLLCPP Exception {
public:
// Creates an exception with a function name where the failure occurs
// and an optional detailed message
- Exception(const string func_name, const string message = DEFAULT_MSG);
+ Exception(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
// Returns a character string that describes the error specified by
// a major error number.
- string getMajorString( hid_t err_major_id ) const;
+ H5_std::string getMajorString( hid_t err_major_id ) const;
// Returns a character string that describes the error specified by
// a minor error number.
- string getMinorString( hid_t err_minor_id ) const;
+ H5_std::string getMinorString( hid_t err_minor_id ) const;
// Returns the detailed message set at the time the exception is thrown
- string getDetailMsg() const;
+ H5_std::string getDetailMsg() const;
const char* getCDetailMsg() const; // C string of detailed message
- string getFuncName() const; // function name as a string object
+ H5_std::string getFuncName() const; // function name as a string object
const char* getCFuncName() const; // function name as a char string
// Turns on the automatic error printing.
@@ -82,80 +84,80 @@ class H5_DLLCPP Exception {
#if defined(WIN32)
#pragma warning(disable: 4251)
#endif
- string detail_message;
- string func_name;
+ H5_std::string detail_message;
+ H5_std::string func_name;
protected:
// Default value for detail_message
- static const string DEFAULT_MSG;
+ static const H5_std::string DEFAULT_MSG;
};
class H5_DLLCPP FileIException : public Exception {
public:
- FileIException( const string func_name, const string message = DEFAULT_MSG);
+ FileIException( const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
FileIException();
virtual ~FileIException();
};
class H5_DLLCPP GroupIException : public Exception {
public:
- GroupIException( const string func_name, const string message = DEFAULT_MSG);
+ GroupIException( const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
GroupIException();
virtual ~GroupIException();
};
class H5_DLLCPP DataSpaceIException : public Exception {
public:
- DataSpaceIException(const string func_name, const string message = DEFAULT_MSG);
+ DataSpaceIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
DataSpaceIException();
virtual ~DataSpaceIException();
};
class H5_DLLCPP DataTypeIException : public Exception {
public:
- DataTypeIException(const string func_name, const string message = DEFAULT_MSG);
+ DataTypeIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
DataTypeIException();
virtual ~DataTypeIException();
};
class H5_DLLCPP PropListIException : public Exception {
public:
- PropListIException(const string func_name, const string message = DEFAULT_MSG);
+ PropListIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
PropListIException();
virtual ~PropListIException();
};
class H5_DLLCPP DataSetIException : public Exception {
public:
- DataSetIException(const string func_name, const string message = DEFAULT_MSG);
+ DataSetIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
DataSetIException();
virtual ~DataSetIException();
};
class H5_DLLCPP AttributeIException : public Exception {
public:
- AttributeIException(const string func_name, const string message = DEFAULT_MSG);
+ AttributeIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
AttributeIException();
virtual ~AttributeIException();
};
class H5_DLLCPP ReferenceException : public Exception {
public:
- ReferenceException(const string func_name, const string message = DEFAULT_MSG);
+ ReferenceException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
ReferenceException();
virtual ~ReferenceException();
};
class H5_DLLCPP LibraryIException : public Exception {
public:
- LibraryIException(const string func_name, const string message = DEFAULT_MSG);
+ LibraryIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
LibraryIException();
virtual ~LibraryIException();
};
class H5_DLLCPP IdComponentException : public Exception {
public:
- IdComponentException(const string func_name, const string message = DEFAULT_MSG);
+ IdComponentException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG);
IdComponentException();
virtual ~IdComponentException();
};