diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2013-03-22 22:29:55 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2013-03-22 22:29:55 (GMT) |
commit | 865bf6bcb28273de759600a3e3ac4cd31e9788b4 (patch) | |
tree | 042d97eae71024f4440b8d492ddccb6f5df1a2e8 /c++/src/H5File.cpp | |
parent | 8ffd55478e11904f193b4a98477b3bcb452b93ac (diff) | |
parent | 99b15244742caf98b5ff634f34d880fd0089d8d4 (diff) | |
download | hdf5-865bf6bcb28273de759600a3e3ac4cd31e9788b4.zip hdf5-865bf6bcb28273de759600a3e3ac4cd31e9788b4.tar.gz hdf5-865bf6bcb28273de759600a3e3ac4cd31e9788b4.tar.bz2 |
[svn-r23435] ported revisions 23346:23432 from the trunk
Diffstat (limited to 'c++/src/H5File.cpp')
-rw-r--r-- | c++/src/H5File.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 92c4d32..ede7469 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -61,7 +61,7 @@ H5File::H5File() : H5Location(), 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() : H5Location(), 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 ) : H5Location(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 ) : H5Location(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; + } } //-------------------------------------------------------------------------- @@ -187,7 +201,7 @@ bool H5File::isHdf5(const H5std_string& name ) ///\param name - IN: Name of the file ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to -/// FileCreatPropList::DEFAULT +/// FileAccPropList::DEFAULT ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is |