summaryrefslogtreecommitdiffstats
path: root/c++/src/H5File.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-04-11 19:44:31 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-04-11 19:44:31 (GMT)
commitbee3ca742946eff20f64e35048dc00429b99e362 (patch)
tree32b6f476e2783c1c306d8a1b7d406b5f861465b1 /c++/src/H5File.cpp
parent1f2db88a88be64145e4fbb6d6c48fa754613034b (diff)
downloadhdf5-bee3ca742946eff20f64e35048dc00429b99e362.zip
hdf5-bee3ca742946eff20f64e35048dc00429b99e362.tar.gz
hdf5-bee3ca742946eff20f64e35048dc00429b99e362.tar.bz2
Description:
Only format changes: mostly tabs vs. spaces Platforms tested: Linux/64 (jelly)
Diffstat (limited to 'c++/src/H5File.cpp')
-rw-r--r--c++/src/H5File.cpp528
1 files changed, 264 insertions, 264 deletions
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index d1b7b06..9475da9 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -45,74 +45,74 @@ namespace H5 {
#endif // H5_NO_STD
//--------------------------------------------------------------------------
-// Function H5File default constructor
-///\brief Default constructor: creates a stub H5File object.
-// Programmer Binh-Minh Ribler - 2000
+// Function H5File default constructor
+///\brief Default constructor: creates a stub H5File object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief Creates or opens an HDF5 file depending on the parameter flags.
-///\param name - IN: Name of the file
-///\param flags - IN: File access flags
-///\param create_plist - IN: File creation property list, used when
-/// modifying default file meta-data. Default to
-/// FileCreatPropList::DEFAULT
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
+// Function: H5File overloaded constructor
+///\brief Creates or opens an HDF5 file depending on the parameter flags.
+///\param name - IN: Name of the file
+///\param flags - IN: File access flags
+///\param create_plist - IN: File creation property list, used when
+/// modifying default file meta-data. Default to
+/// FileCreatPropList::DEFAULT
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
///\par Description
-/// Valid values of \a flags include:
-/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
-/// erasing all data previously stored in
-/// the file.
-/// \li \c H5F_ACC_EXCL - Fail if file already exists.
-/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive
-/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already
-/// exists, and fail, otherwise
-/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
-/// exists, and fail, otherwise
+/// Valid values of \a flags include:
+/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
+/// erasing all data previously stored in
+/// the file.
+/// \li \c H5F_ACC_EXCL - Fail if file already exists.
+/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive
+/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already
+/// exists, and fail, otherwise
+/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
+/// exists, and fail, otherwise
///\par
-/// For info on file creation in the case of an already-open file,
-/// please refer to the \b Special \b case section in the C layer
-/// Reference Manual at:
+/// For info on file creation in the case of an already-open file,
+/// 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
+// 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(), CommonFG(), id(H5I_INVALID_HID)
{
try {
- p_get_file(name, flags, create_plist, access_plist);
+ p_get_file(name, flags, create_plist, access_plist);
} catch (FileIException& open_file) {
- throw open_file;
+ throw open_file;
}
}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief This is another overloaded constructor. It differs from the
-/// above constructor only in the type of the \a name argument.
-///\param name - IN: Name of the file - \c H5std_string
-///\param flags - IN: File access flags
-///\param create_plist - IN: File creation property list, used when
-/// modifying default file meta-data. Default to
-/// FileCreatPropList::DEFAULT
-///\param access_plist - IN: File access property list. Default to
-/// 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
+// Function: H5File overloaded constructor
+///\brief This is another overloaded constructor. It differs from the
+/// above constructor only in the type of the \a name argument.
+///\param name - IN: Name of the file - \c H5std_string
+///\param flags - IN: File access flags
+///\param create_plist - IN: File creation property list, used when
+/// modifying default file meta-data. Default to
+/// FileCreatPropList::DEFAULT
+///\param access_plist - IN: File access property list. Default to
+/// 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(), CommonFG(), id(H5I_INVALID_HID)
{
try {
- p_get_file(name.c_str(), flags, create_plist, access_plist);
+ p_get_file(name.c_str(), flags, create_plist, access_plist);
} catch (FileIException& open_file) {
- throw open_file;
+ throw open_file;
}
}
@@ -120,10 +120,10 @@ H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPro
//--------------------------------------------------------------------------
// This function is private and contains common code between the
// constructors taking a string or a char*
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - removed H5F_ACC_CREAT because H5Fcreate will fail with
-// H5F_ACC_CREAT. - BMR, Sep 17, 2014
+// - removed H5F_ACC_CREAT because H5Fcreate will fail with
+// H5F_ACC_CREAT. - BMR, Sep 17, 2014
//--------------------------------------------------------------------------
void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist)
{
@@ -131,38 +131,38 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
// create the file.
if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))
{
- hid_t create_plist_id = create_plist.getId();
- hid_t access_plist_id = access_plist.getId();
- id = H5Fcreate( name, flags, create_plist_id, access_plist_id );
- if( id < 0 ) // throw an exception when open/create fail
- {
- throw FileIException("H5File constructor", "H5Fcreate failed");
- }
+ hid_t create_plist_id = create_plist.getId();
+ hid_t access_plist_id = access_plist.getId();
+ id = H5Fcreate( name, flags, create_plist_id, access_plist_id );
+ if( id < 0 ) // throw an exception when open/create fail
+ {
+ throw FileIException("H5File constructor", "H5Fcreate failed");
+ }
}
// Open the file if none of the bits above are set.
else
{
- hid_t access_plist_id = access_plist.getId();
- id = H5Fopen( name, flags, access_plist_id );
- if( id < 0 ) // throw an exception when open/create fail
- {
- throw FileIException("H5File constructor", "H5Fopen failed");
- }
+ hid_t access_plist_id = access_plist.getId();
+ id = H5Fopen( name, flags, access_plist_id );
+ if( id < 0 ) // throw an exception when open/create fail
+ {
+ throw FileIException("H5File constructor", "H5Fopen failed");
+ }
}
}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief Creates an H5File object using an existing file id.
-///\param existing_id - IN: Id of an existing file
-// Programmer Binh-Minh Ribler - 2015
+// Function: H5File overloaded constructor
+///\brief Creates an H5File object using an existing file id.
+///\param existing_id - IN: Id of an existing file
+// Programmer Binh-Minh Ribler - 2015
// Description
-// Mar 29, 2015
-// Added in responding to a request from user Jason Newton.
-// However, it is not recommended to use the private member "id"
-// in applications. Unlike other situations, where similar
-// constructor is needed by the library in order to return
-// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
+// Mar 29, 2015
+// Added in responding to a request from user Jason Newton.
+// However, it is not recommended to use the private member "id"
+// in applications. Unlike other situations, where similar
+// constructor is needed by the library in order to return
+// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
//--------------------------------------------------------------------------
H5File::H5File(hid_t existing_id) : H5Location(), CommonFG()
{
@@ -173,11 +173,11 @@ H5File::H5File(hid_t existing_id) : H5Location(), CommonFG()
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// H5File object.
-///\param original - IN: H5File instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// H5File object.
+///\param original - IN: H5File instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File(const H5File& original) : H5Location(), CommonFG()
{
@@ -186,12 +186,12 @@ H5File::H5File(const H5File& original) : H5Location(), CommonFG()
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5 (static)
-///\brief Determines whether a file in HDF5 format. (Static)
-///\param name - IN: Name of the file
-///\return true if the file is in HDF5 format, and false, otherwise
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::isHdf5 (static)
+///\brief Determines whether a file in HDF5 format. (Static)
+///\param name - IN: Name of the file
+///\return true if the file is in HDF5 format, and false, otherwise
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const char* name)
{
@@ -209,11 +209,11 @@ bool H5File::isHdf5(const char* name)
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5 (static)
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes an \c H5std_string for \a name. (Static)
-///\param name - IN: Name of the file - \c H5std_string
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::isHdf5 (static)
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes an \c H5std_string for \a name. (Static)
+///\param name - IN: Name of the file - \c H5std_string
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const H5std_string& name )
{
@@ -221,22 +221,22 @@ bool H5File::isHdf5(const H5std_string& name )
}
//--------------------------------------------------------------------------
-// Function: openFile
-///\brief Opens an HDF5 file
-///\param name - IN: Name of the file
-///\param flags - IN: File access flags
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
+// Function: openFile
+///\brief Opens an HDF5 file
+///\param name - IN: Name of the file
+///\param flags - IN: File access flags
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
///\par Description
-/// Valid values of \a flags include:
-/// H5F_ACC_RDWR: Open with read/write access. If the file is
-/// currently open for read-only access then it
-/// will be reopened. Absence of this flag
-/// implies read-only access.
+/// Valid values of \a flags include:
+/// H5F_ACC_RDWR: Open with read/write access. If the file is
+/// currently open for read-only access then it
+/// will be reopened. Absence of this flag
+/// implies read-only access.
///
-/// H5F_ACC_RDONLY: Open with read only access. - default
+/// H5F_ACC_RDONLY: Open with read only access. - default
///
-// Programmer Binh-Minh Ribler - Oct, 2005
+// Programmer Binh-Minh Ribler - Oct, 2005
//--------------------------------------------------------------------------
void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist)
{
@@ -251,19 +251,19 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis
id = H5Fopen (name, flags, access_plist_id);
if (id < 0) // throw an exception when open fails
{
- throw FileIException("H5File::openFile", "H5Fopen failed");
+ throw FileIException("H5File::openFile", "H5Fopen failed");
}
}
//--------------------------------------------------------------------------
-// Function: H5File::openFile
-///\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
-///\param flags - IN: File access flags
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::openFile
+///\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
+///\param flags - IN: File access flags
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist)
{
@@ -271,21 +271,21 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc
}
//--------------------------------------------------------------------------
-// Function: H5File::reOpen
-///\brief Reopens this file.
+// Function: H5File::reOpen
+///\brief Reopens this file.
///
-///\exception H5::FileIException
+///\exception H5::FileIException
// Description
-// If this object has represented another HDF5 file, the previous
-// HDF5 file need to be closed first.
-// Programmer Binh-Minh Ribler - 2000
+// If this object has represented another HDF5 file, the previous
+// HDF5 file need to be closed first.
+// Programmer Binh-Minh Ribler - 2000
// Note: This wrapper doesn't seem right regarding the 'id' and should
// be investigated. BMR - 2/20/2005
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Feb 20, 2005
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Feb 20, 2005
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
void H5File::reOpen()
{
@@ -304,11 +304,11 @@ void H5File::reOpen()
}
//--------------------------------------------------------------------------
-// Function: H5File::getCreatePlist
-///\brief Returns the creation property list of this file
-///\return FileCreatPropList object
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::getCreatePlist
+///\brief Returns the creation property list of this file
+///\return FileCreatPropList object
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileCreatPropList H5File::getCreatePlist() const
{
@@ -328,11 +328,11 @@ FileCreatPropList H5File::getCreatePlist() const
}
//--------------------------------------------------------------------------
-// Function: H5File::getAccessPlist
-///\brief Returns the access property list of this file
-///\return FileAccPropList object
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::getAccessPlist
+///\brief Returns the access property list of this file
+///\return FileAccPropList object
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList H5File::getAccessPlist() const
{
@@ -352,10 +352,10 @@ FileAccPropList H5File::getAccessPlist() const
}
//--------------------------------------------------------------------------
-// Function: H5File::getFreeSpace
-///\brief Returns the amount of free space in the file.
-///\return Amount of free space
-///\exception H5::FileIException
+// Function: H5File::getFreeSpace
+///\brief Returns the amount of free space in the file.
+///\return Amount of free space
+///\exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
hssize_t H5File::getFreeSpace() const
@@ -370,22 +370,22 @@ hssize_t H5File::getFreeSpace() const
//--------------------------------------------------------------------------
-// Function: H5File::getObjCount
-///\brief Returns the number of opened object IDs (files, datasets,
-/// groups and datatypes) in the same file.
-///\param types - Type of object to retrieve the count
-///\return Number of opened object IDs
-///\exception H5::FileIException
+// Function: H5File::getObjCount
+///\brief Returns the number of opened object IDs (files, datasets,
+/// groups and datatypes) in the same file.
+///\param types - Type of object to retrieve the count
+///\return Number of opened object IDs
+///\exception H5::FileIException
///\par Description
-/// The valid values for \a types include:
-/// \li \c H5F_OBJ_FILE - Files only
-/// \li \c H5F_OBJ_DATASET - Datasets only
-/// \li \c H5F_OBJ_GROUP - Groups only
-/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
-/// \li \c H5F_OBJ_ATTR - Attributes only
-/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
-/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
-/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
+/// The valid values for \a types include:
+/// \li \c H5F_OBJ_FILE - Files only
+/// \li \c H5F_OBJ_DATASET - Datasets only
+/// \li \c H5F_OBJ_GROUP - Groups only
+/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
+/// \li \c H5F_OBJ_ATTR - Attributes only
+/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
+/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
+/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
///\par
/// Multiple object types can be combined with the logical OR operator (|).
// Programmer Binh-Minh Ribler - May 2004
@@ -401,24 +401,24 @@ ssize_t H5File::getObjCount(unsigned types) const
}
//--------------------------------------------------------------------------
-// Function: H5File::getObjIDs
-///\brief Retrieves a list of opened object IDs (files, datasets,
-/// groups and datatypes) in the same file.
-///\param types - Type of object to retrieve the count
-///\param max_objs - Maximum number of object identifiers to place
-/// into obj_id_list.
-///\param oid_list - List of open object identifiers
-///\exception H5::FileIException
+// Function: H5File::getObjIDs
+///\brief Retrieves a list of opened object IDs (files, datasets,
+/// groups and datatypes) in the same file.
+///\param types - Type of object to retrieve the count
+///\param max_objs - Maximum number of object identifiers to place
+/// into obj_id_list.
+///\param oid_list - List of open object identifiers
+///\exception H5::FileIException
///\par Description
-/// The valid values for \a types include:
-/// \li \c H5F_OBJ_FILE - Files only
-/// \li \c H5F_OBJ_DATASET - Datasets only
-/// \li \c H5F_OBJ_GROUP - Groups only
-/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
-/// \li \c H5F_OBJ_ATTR - Attributes only
-/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
-/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
-/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
+/// The valid values for \a types include:
+/// \li \c H5F_OBJ_FILE - Files only
+/// \li \c H5F_OBJ_DATASET - Datasets only
+/// \li \c H5F_OBJ_GROUP - Groups only
+/// \li \c H5F_OBJ_DATATYPE - Named datatypes only
+/// \li \c H5F_OBJ_ATTR - Attributes only
+/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE
+/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP
+/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR
///\par
/// Multiple object types can be combined with the logical OR operator (|).
//
@@ -435,25 +435,25 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const
}
//--------------------------------------------------------------------------
-// Function: H5File::getVFDHandle
-///\brief Returns the pointer to the file handle of the low-level file
-/// driver.
-///\param fapl - File access property list
-///\param file_handle - Pointer to the file handle being used by
-/// the low-level virtual file driver
-///\exception H5::FileIException
+// Function: H5File::getVFDHandle
+///\brief Returns the pointer to the file handle of the low-level file
+/// driver.
+///\param fapl - File access property list
+///\param file_handle - Pointer to the file handle being used by
+/// the low-level virtual file driver
+///\exception H5::FileIException
///\par Description
-/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
-/// defined through the property list functions:
-/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
-/// and \c FileAccPropList::setMultiType for the \c MULTI driver.
+/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
+/// defined through the property list functions:
+/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
+/// and \c FileAccPropList::setMultiType for the \c MULTI driver.
///
-/// The obtained file handle is dynamic and is valid only while
-/// the file remains open; it will be invalid if the file is
-/// closed and reopened or opened during a subsequent session.
+/// The obtained file handle is dynamic and is valid only while
+/// the file remains open; it will be invalid if the file is
+/// closed and reopened or opened during a subsequent session.
// Programmer Binh-Minh Ribler - May 2004
// Modification
-// Replaced the version without const parameter - Apr, 2014
+// Replaced the version without const parameter - Apr, 2014
//--------------------------------------------------------------------------
void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
{
@@ -466,19 +466,19 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
}
//--------------------------------------------------------------------------
-// Function: H5File::getVFDHandle
-// Purpose This is an overloaded member function, kept for backward
-// compatibility. It differs from the above function in that it
-// misses const's. This wrapper will be removed in future release.
-// Param fapl - File access property list
-// Param file_handle - Pointer to the file handle being used by
-// the low-level virtual file driver
-// Exception H5::FileIException
+// Function: H5File::getVFDHandle
+// Purpose This is an overloaded member function, kept for backward
+// compatibility. It differs from the above function in that it
+// misses const's. This wrapper will be removed in future release.
+// Param fapl - File access property list
+// Param file_handle - Pointer to the file handle being used by
+// the low-level virtual file driver
+// Exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
// Modification
-// Planned for removal. -BMR, 2014/04/16
-// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
-// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1
+// Planned for removal. -BMR, 2014/04/16
+// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
+// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1
//--------------------------------------------------------------------------
//void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const
//{
@@ -486,13 +486,13 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
//}
//--------------------------------------------------------------------------
-// Function: H5File::getVFDHandle
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param file_handle - Pointer to the file handle being used by
-/// the low-level virtual file driver
-///\exception H5::FileIException
+// Function: H5File::getVFDHandle
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param file_handle - Pointer to the file handle being used by
+/// the low-level virtual file driver
+///\exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
void H5File::getVFDHandle(void **file_handle) const
@@ -505,13 +505,13 @@ void H5File::getVFDHandle(void **file_handle) const
}
//--------------------------------------------------------------------------
-// Function: H5File::getFileSize
-///\brief Returns the file size of the HDF5 file.
-///\return File size
-///\exception H5::FileIException
+// Function: H5File::getFileSize
+///\brief Returns the file size of the HDF5 file.
+///\return File size
+///\exception H5::FileIException
///\par Description
-/// This function is called after an existing file is opened in
-/// order to learn the true size of the underlying file.
+/// This function is called after an existing file is opened in
+/// order to learn the true size of the underlying file.
// Programmer Raymond Lu - June 24, 2004
//--------------------------------------------------------------------------
hsize_t H5File::getFileSize() const
@@ -526,16 +526,16 @@ hsize_t H5File::getFileSize() const
}
//--------------------------------------------------------------------------
-// Function: H5File::getId
-///\brief Get the id of this file
-///\return File identifier
+// Function: H5File::getId
+///\brief Get the id of this file
+///\return File identifier
// Modification:
-// May 2008 - BMR
-// Class hierarchy is revised to address bugzilla 1068. Class
-// AbstractDS and Attribute are moved out of H5Object. In
-// addition, member IdComponent::id is moved into subclasses, and
-// IdComponent::getId now becomes pure virtual function.
-// Programmer Binh-Minh Ribler - May, 2008
+// May 2008 - BMR
+// Class hierarchy is revised to address bugzilla 1068. Class
+// AbstractDS and Attribute are moved out of H5Object. In
+// addition, member IdComponent::id is moved into subclasses, and
+// IdComponent::getId now becomes pure virtual function.
+// Programmer Binh-Minh Ribler - May, 2008
//--------------------------------------------------------------------------
hid_t H5File::getId() const
{
@@ -544,12 +544,12 @@ hid_t H5File::getId() const
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File::reopen
-// Purpose: Reopens this file.
-// Exception H5::FileIException
+// Function: H5File::reopen
+// Purpose: Reopens this file.
+// Exception H5::FileIException
// Description
-// This function is replaced by the above function reOpen.
-// Programmer Binh-Minh Ribler - 2000
+// This function is replaced by the above function reOpen.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::reopen()
{
@@ -557,12 +557,12 @@ void H5File::reopen()
}
//--------------------------------------------------------------------------
-// Function: H5File::getLocId
-// Purpose: Get the id of this file
+// Function: H5File::getLocId
+// Purpose: Get the id of this file
// Description
-// This function is a redefinition of CommonFG::getLocId. It
-// is used by CommonFG member functions to get the file id.
-// Programmer Binh-Minh Ribler - 2000
+// This function is a redefinition of CommonFG::getLocId. It
+// is used by CommonFG member functions to get the file id.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hid_t H5File::getLocId() const
{
@@ -570,16 +570,16 @@ hid_t H5File::getLocId() const
}
//--------------------------------------------------------------------------
-// Function: H5File::p_setId (protected)
-///\brief Sets the identifier of this object to a new value.
+// Function: H5File::p_setId (protected)
+///\brief Sets the identifier of this object to a new value.
///
-///\exception H5::IdComponentException when the attempt to close the HDF5
-/// object fails
+///\exception H5::IdComponentException when the attempt to close the HDF5
+/// object fails
// Description:
-// The underlaying reference counting in the C library ensures
-// that the current valid id of this object is properly closed.
-// Then the object's id is reset to the new id.
-// Programmer Binh-Minh Ribler - 2000
+// The underlaying reference counting in the C library ensures
+// that the current valid id of this object is properly closed.
+// Then the object's id is reset to the new id.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::p_setId(const hid_t new_id)
{
@@ -596,39 +596,39 @@ void H5File::p_setId(const hid_t new_id)
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File::close
-///\brief Closes this HDF5 file.
+// Function: H5File::close
+///\brief Closes this HDF5 file.
///
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void H5File::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Fclose( id );
- if( ret_value < 0 )
- {
- throw FileIException("H5File::close", "H5Fclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Fclose( id );
+ if( ret_value < 0 )
+ {
+ throw FileIException("H5File::close", "H5Fclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: H5File::throwException
-///\brief Throws file exception - initially implemented for CommonFG
-///\param func_name - Name of the function where failure occurs
-///\param msg - Message describing the failure
-///\exception H5::FileIException
+// Function: H5File::throwException
+///\brief Throws file exception - initially implemented for CommonFG
+///\param func_name - Name of the function where failure occurs
+///\param msg - Message describing the failure
+///\exception H5::FileIException
// Description
-// This function is used in CommonFG implementation so that
-// proper exception can be thrown for file or group. The
-// argument func_name is a member of CommonFG and "H5File::"
-// will be inserted to indicate the function called is an
-// implementation of H5File.
-// Programmer Binh-Minh Ribler - 2000
+// This function is used in CommonFG implementation so that
+// proper exception can be thrown for file or group. The
+// argument func_name is a member of CommonFG and "H5File::"
+// will be inserted to indicate the function called is an
+// implementation of H5File.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const
{
@@ -638,21 +638,21 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m
}
//--------------------------------------------------------------------------
-// Function: H5File destructor
-///\brief Properly terminates access to this file.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File destructor
+///\brief Properly terminates access to this file.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Feb 20, 2005
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Feb 20, 2005
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
H5File::~H5File()
{
try {
- close();
+ close();
} catch (Exception& close_error) {
- cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
+ cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
}
}