From 4620776d72dc398dd134f4b266a38350d6cb7f60 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 3 Dec 2005 07:28:55 -0500 Subject: [PATCH] [svn-r11757] Purpose: Example code improvement Description: Improved the use of std members. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) Linux 2.4 w/PGI (colonelk) --- c++/examples/chunks.cpp | 16 ++++++++++------ c++/examples/compound.cpp | 16 ++++++++++------ c++/examples/create.cpp | 10 ++++++++-- c++/examples/extend_ds.cpp | 16 ++++++++++------ c++/examples/h5group.cpp | 15 ++++++++++----- c++/examples/readdata.cpp | 16 ++++++++++------ c++/examples/writedata.cpp | 16 ++++++++++------ 7 files changed, 68 insertions(+), 37 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 19718ac6b8..99f386bb94 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -17,21 +17,25 @@ * We will read from the file created by extend.C */ -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "SDSextendible.h5" ); diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 741586a8af..37df231383 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -18,21 +18,25 @@ * and read back fields' subsets. */ -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "SDScompound.h5" ); diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index de7dcc63e3..85afc895f0 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -16,13 +16,19 @@ * This example writes a dataset to a new HDF5 file. */ -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index a4cd0e1cad..5ec6448c5e 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -19,21 +19,25 @@ * */ -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "SDSextendible.h5" ); diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index bb798b2c06..437ba17bcf 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -20,21 +20,26 @@ * Note that the C++ API iterator function is not completed yet, thus * the C version is used in this example. */ -#include #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "Group.h5" ); diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 776c3229b0..8f00e33645 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -18,21 +18,25 @@ // information about the dataset in the SDS.h5 file is obtained. // -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "SDS.h5" ); diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 89cf0b96e9..388939d1c9 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -21,21 +21,25 @@ * file is closed. Program reopens the file and reads and displays the result. */ -#include - #ifdef OLD_HEADER_FILENAME #include #else #include #endif +#include + +#ifndef H5_NO_NAMESPACE +#ifndef H5_NO_STD + using std::string; + using std::cout; + using std::endl; +#endif // H5_NO_STD +#endif + #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD #endif const string FILE_NAME( "Select.h5" );