From 6496413284a3319bc41ad3ebde3783bae02d6e23 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 18 Aug 2005 17:16:56 -0500 Subject: [svn-r11264] Purpose: Additional code improvement Description: Used "using" declaration and directive better to reduce namespace pollution. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) --- c++/src/H5Attribute.cpp | 3 +++ c++/src/H5DataSet.cpp | 3 +++ c++/src/H5DataSpace.cpp | 3 +++ c++/src/H5DataType.cpp | 3 +++ c++/src/H5Exception.h | 2 +- c++/src/H5File.cpp | 3 +++ c++/src/H5Group.cpp | 3 +++ c++/src/H5IdComponent.h | 8 ++++++++ c++/src/H5PropList.cpp | 3 +++ 9 files changed, 30 insertions(+), 1 deletion(-) diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 9a177b9..1939f6f 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -33,6 +33,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 34a87d7..8e5eef0 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -35,6 +35,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 7ed6ae2..25efc93 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -26,6 +26,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 62dca0f..987d0a1 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -34,6 +34,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 41a6e24..3d9c85d 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -21,7 +21,7 @@ #ifndef H5_NO_NAMESPACE namespace H5 { #ifndef H5_NO_STD - using namespace std; + using std::string; #endif // H5_NO_STD #endif diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 54c4f6d..fbb6a49 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -38,6 +38,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 6bf25a1..88b8bdd 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -38,6 +38,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 33fa7d2..5648380 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -61,10 +61,18 @@ class H5_DLLCPP IdComponent { // Makes and returns the string "::"; // is returned by fromClass(). +#ifdef H5_NO_STD string inMemFunc(const char* func_name) const; +#else + std::string inMemFunc(const char* func_name) const; +#endif // H5_NO_STD // Returns this class name. +#ifdef H5_NO_STD virtual string fromClass() const {return ("IdComponent");} +#else + virtual std::string fromClass() const {return ("IdComponent");} +#endif // H5_NO_STD #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index ff46e29..3eb0b84 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -26,6 +26,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif //-------------------------------------------------------------------------- -- cgit v0.12