summaryrefslogtreecommitdiffstats
path: root/c++/src/H5File.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2013-03-29 04:03:20 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2013-03-29 04:03:20 (GMT)
commit8461df0911aecf6665b4a19d4a66e4d11bc31e3c (patch)
tree7c732c6dd13fbb1b64c57b2753459760d2f7191e /c++/src/H5File.cpp
parent54319cf88d1fece145a47960452ace57f3487f8f (diff)
downloadhdf5-8461df0911aecf6665b4a19d4a66e4d11bc31e3c.zip
hdf5-8461df0911aecf6665b4a19d4a66e4d11bc31e3c.tar.gz
hdf5-8461df0911aecf6665b4a19d4a66e4d11bc31e3c.tar.bz2
[svn-r23485] Purpose: Fix bug HDFFV-8067
Description: Applied the fix for HDFFV-8067 and the minor cleanups from the trunk. Platforms tested: Linux/32 2.6 (jam) with PGI compilers Linux/32 2.6 (jam) with GNU compilers Linux/64 2.6 (koala) with ICC compilers SunOS 5.10 (emu)
Diffstat (limited to 'c++/src/H5File.cpp')
-rw-r--r--c++/src/H5File.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index da0241f..6e85428 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -61,7 +61,7 @@ H5File::H5File() : IdComponent(), id(0) {}
/// modifying default file meta-data. Default to
/// FileCreatPropList::DEFAULT
///\param access_plist - IN: File access property list. Default to
-/// FileCreatPropList::DEFAULT
+/// FileAccPropList::DEFAULT
///\par Description
/// Valid values of \a flags include:
/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
@@ -77,11 +77,18 @@ H5File::H5File() : IdComponent(), id(0) {}
/// please refer to the \b Special \b case section in the C layer
/// Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create
+// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file
+// could not be caught in the applications. Added try block here
+// to catch then re-throw it. -BMR 2013/03/21
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent(0)
{
- p_get_file(name, flags, create_plist, access_plist);
+ try {
+ p_get_file(name, flags, create_plist, access_plist);
+ } catch (FileIException open_file) {
+ throw open_file;
+ }
}
//--------------------------------------------------------------------------
@@ -94,12 +101,19 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
/// modifying default file meta-data. Default to
/// FileCreatPropList::DEFAULT
///\param access_plist - IN: File access property list. Default to
-/// FileCreatPropList::DEFAULT
+/// FileAccPropList::DEFAULT
+// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file
+// could not be caught in the applications. Added try block here
+// to catch then re-throw it. -BMR 2013/03/21
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent(0)
{
- p_get_file(name.c_str(), flags, create_plist, access_plist);
+ try {
+ p_get_file(name.c_str(), flags, create_plist, access_plist);
+ } catch (FileIException open_file) {
+ throw open_file;
+ }
}
//--------------------------------------------------------------------------
@@ -166,7 +180,7 @@ void H5File::flush(H5F_scope_t scope) const
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5
+// Function: H5File::isHdf5 (static)
///\brief Determines whether a file in HDF5 format.
///\param name - IN: Name of the file
///\return true if the file is in HDF5 format, and false, otherwise
@@ -189,7 +203,7 @@ bool H5File::isHdf5(const char* name)
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5
+// Function: H5File::isHdf5 (static)
///\brief This is an overloaded member function, provided for convenience.
/// It takes an \c H5std_string for \a name.
///\param name - IN: Name of the file - \c H5std_string