HDF5 C++ API  1.8.20
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Static Public Member Functions | List of all members
H5::H5File Class Reference

Class H5File represents an HDF5 file. More...

#include <H5File.h>

Inheritance diagram for H5::H5File:
H5::Group H5::H5Object H5::CommonFG H5::H5Location H5::IdComponent

Public Member Functions

 H5File (const char *name, unsigned int flags, const FileCreatPropList &create_plist=FileCreatPropList::DEFAULT, const FileAccPropList &access_plist=FileAccPropList::DEFAULT)
 Creates or opens an HDF5 file depending on the parameter flags. More...
 
 H5File (const H5std_string &name, unsigned int flags, const FileCreatPropList &create_plist=FileCreatPropList::DEFAULT, const FileAccPropList &access_plist=FileAccPropList::DEFAULT)
 This is another overloaded constructor. It differs from the above constructor only in the type of the name argument. More...
 
void openFile (const H5std_string &name, unsigned int flags, const FileAccPropList &access_plist=FileAccPropList::DEFAULT)
 This is an overloaded member function, provided for convenience. It takes an H5std_string for name. More...
 
void openFile (const char *name, unsigned int flags, const FileAccPropList &access_plist=FileAccPropList::DEFAULT)
 Opens an HDF5 file. More...
 
virtual void close ()
 Closes this HDF5 file. More...
 
FileAccPropList getAccessPlist () const
 Returns the access property list of this file. More...
 
FileCreatPropList getCreatePlist () const
 Returns the creation property list of this file. More...
 
void getFileInfo (H5F_info_t &file_info) const
 Retrieves the general information of this file. More...
 
hsize_t getFileSize () const
 Returns the file size of the HDF5 file. More...
 
hssize_t getFreeSpace () const
 Returns the amount of free space in the file. More...
 
ssize_t getObjCount (unsigned types=H5F_OBJ_ALL) const
 Returns the number of opened object IDs (files, datasets, groups and datatypes) in the same file. More...
 
void getObjIDs (unsigned types, size_t max_objs, hid_t *oid_list) const
 Retrieves a list of opened object IDs (files, datasets, groups and datatypes) in the same file. More...
 
void getVFDHandle (void **file_handle) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts. More...
 
void getVFDHandle (const FileAccPropList &fapl, void **file_handle) const
 Returns the pointer to the file handle of the low-level file driver. More...
 
void reOpen ()
 Reopens this file. More...
 
virtual H5std_string fromClass () const
 Returns this class name. More...
 
virtual void throwException (const H5std_string &func_name, const H5std_string &msg) const
 Throws file exception - initially implemented for CommonFG. More...
 
 H5File ()
 Default constructor: creates a stub H5File object. More...
 
 H5File (const H5File &original)
 Copy constructor: makes a copy of the original H5File object. More...
 
virtual hid_t getId () const
 Get the id of this file. More...
 
virtual ~H5File ()
 Properly terminates access to this file. More...
 
- Public Member Functions inherited from H5::Group
virtual hid_t getLocId () const
 Returns the id of this group. More...
 
 Group (const H5Location &loc, const void *ref, H5R_type_t ref_type=H5R_OBJECT)
 Given a reference, ref, to an hdf5 group, creates a Group object. More...
 
 Group ()
 Default constructor: creates a stub Group. More...
 
 Group (const Group &original)
 Copy constructor: makes a copy of the original Group object. More...
 
virtual ~Group ()
 Properly terminates access to this group. More...
 
 Group (const hid_t group_id)
 Creates a Group object using the id of an existing group. More...
 
- Public Member Functions inherited from H5::H5Object
Attribute createAttribute (const char *name, const DataType &type, const DataSpace &space, const PropList &create_plist=PropList::DEFAULT) const
 Deprecated - replaced by H5Object::createAttribute. More...
 
Attribute createAttribute (const H5std_string &name, const DataType &type, const DataSpace &space, const PropList &create_plist=PropList::DEFAULT) const
 Deprecated - replaced by H5Object::createAttribute. More...
 
Attribute openAttribute (const char *name) const
 Deprecated - replaced by H5Object::openAttribute. More...
 
Attribute openAttribute (const H5std_string &name) const
 Deprecated - replaced by H5Object::openAttribute. More...
 
Attribute openAttribute (const unsigned int idx) const
 Deprecated - replaced by H5Object::openAttribute. More...
 
bool attrExists (const char *name) const
 Deprecated - replaced by H5Object::attrExists() More...
 
bool attrExists (const H5std_string &name) const
 Deprecated - replaced by H5Object::attrExists() More...
 
void renameAttr (const char *oldname, const char *newname) const
 Deprecated - replaced by H5Object::renameAttr() More...
 
void renameAttr (const H5std_string &oldname, const H5std_string &newname) const
 Deprecated - replaced by H5Object::renameAttr() More...
 
void removeAttr (const char *name) const
 Deprecated - replaced by H5Object::removeAttr() More...
 
void removeAttr (const H5std_string &name) const
 Deprecated - replaced by H5Object::removeAttr() More...
 
int getNumAttrs () const
 
ssize_t getObjName (char *obj_name, size_t buf_size=0) const
 
ssize_t getObjName (H5std_string &obj_name, size_t len=0) const
 
H5std_string getObjName () const
 
- Public Member Functions inherited from H5::H5Location
bool nameExists (const char *name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Checks if a link of a given name exists in a location. More...
 
bool nameExists (const H5std_string &name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Checks if a link of a given name exists in a location. More...
 
void flush (H5F_scope_t scope) const
 Flushes all buffers associated with a location to disk. More...
 
H5std_string getFileName () const
 Gets the name of the file, in which this HDF5 object belongs. More...
 
void getObjectInfo (H5O_info_t *oinfo) const
 Retrieve information about an object, specified by location.

Exceptions
H5::LocationException.
More...
 
void getObjectInfo (const char *name, H5O_info_t *oinfo, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Retrieve information about an object, specified by name.

Exceptions
H5::LocationException.
More...
 
void getObjectInfo (const H5std_string &name, H5O_info_t *oinfo, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Retrieve information about an object, specified by name.

Exceptions
H5::LocationException.
More...
 
int getNumAttrs () const
 Deprecated - replaced by H5Object::getNumAttrs() More...
 
H5G_obj_t getObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
 Retrieves the type of object that an object reference points to. More...
 
H5O_type_t getRefObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
 Retrieves the type of object that an object reference points to. More...
 
unsigned objVersion () const
 Returns the header version of this HDF5 object. More...
 
void setComment (const char *name, const char *comment) const
 Sets or resets the comment for an object specified by its name. More...
 
void setComment (const H5std_string &name, const H5std_string &comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name and comment. More...
 
void setComment (const char *comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it doesn't take an object name. More...
 
void setComment (const H5std_string &comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for comment. More...
 
ssize_t getComment (const char *name, size_t buf_size, char *comment) const
 Retrieves the comment for this location, returning its length. More...
 
H5std_string getComment (const char *name, size_t buf_size=0) const
 Returns the comment as string for this location, returning its length. More...
 
H5std_string getComment (const H5std_string &name, size_t buf_size=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void removeComment (const char *name) const
 Removes the comment from an object specified by its name. More...
 
void removeComment (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void reference (void *ref, const char *name, H5R_type_t ref_type=H5R_OBJECT) const
 This is an overloaded function, provided for your convenience. It differs from the above function in that it does not take a DataSpace object and the reference type must be specified. More...
 
void reference (void *ref, const H5std_string &name, H5R_type_t ref_type=H5R_OBJECT) const
 This is an overloaded function, provided for your convenience. It differs from the above function in that it takes an H5std_string for the object's name. More...
 
void reference (void *ref, const char *name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
 Creates a reference to an HDF5 object or a dataset region. More...
 
void reference (void *ref, const H5std_string &name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void dereference (const H5Location &loc, const void *ref, H5R_type_t ref_type=H5R_OBJECT)
 Dereferences a reference into an HDF5 object, given an HDF5 object. More...
 
void dereference (const Attribute &attr, const void *ref, H5R_type_t ref_type=H5R_OBJECT)
 Dereferences a reference into an HDF5 object, given an attribute. More...
 
DataSpace getRegion (void *ref, H5R_type_t ref_type=H5R_DATASET_REGION) const
 Retrieves a dataspace with the region pointed to selected. More...
 
hid_t openObjId (const char *name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Opens an object without knowing the object type. More...
 
hid_t openObjId (const H5std_string &name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 This is an overloaded member function, provided for convenience. It takes a reference to a H5std_string for the object's path. More...
 
void closeObjId (hid_t obj_id) const
 Closes an object, which was opened with H5Location::openObjId. More...
 
virtual int iterateAttrs (attr_operator_t user_op, unsigned *idx=NULL, void *op_data=NULL)
 Iterates a user's function over all the attributes of an H5 object, which may be a group, dataset or named datatype. More...
 
- Public Member Functions inherited from H5::IdComponent
void incRefCount (const hid_t obj_id) const
 Increment reference counter for a given id. More...
 
void incRefCount () const
 Increment reference counter for the id of this object. More...
 
void decRefCount (const hid_t obj_id) const
 Decrement reference counter for a given id. More...
 
void decRefCount () const
 Decrement reference counter for the id of this object. More...
 
int getCounter (const hid_t obj_id) const
 Returns the reference counter for a given id. More...
 
int getCounter () const
 Returns the reference counter for the id of this object. More...
 
H5I_type_t getHDFObjType () const
 Returns the type of the object. It is an overloaded function of the above function. More...
 
IdComponentoperator= (const IdComponent &rhs)
 Assignment operator. More...
 
void setId (const hid_t new_id)
 Sets the identifier of this object to a new value. More...
 
virtual ~IdComponent ()
 Noop destructor. More...
 
- Public Member Functions inherited from H5::CommonFG
Group createGroup (const char *name, size_t size_hint=0) const
 Creates a new group at this location which can be a file or another group. More...
 
Group createGroup (const H5std_string &name, size_t size_hint=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
Group openGroup (const char *name) const
 Opens an existing group in a location which can be a file or another group. More...
 
Group openGroup (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
DataSet createDataSet (const char *name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT) const
 Creates a new dataset at this location. More...
 
DataSet createDataSet (const H5std_string &name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
DataSet openDataSet (const char *name) const
 Opens an existing dataset at this location. More...
 
DataSet openDataSet (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
H5std_string getLinkval (const char *link_name, size_t size=0) const
 Returns the name of the object that the symbolic link points to. More...
 
H5std_string getLinkval (const H5std_string &link_name, size_t size=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
hsize_t getNumObjs () const
 Returns the number of objects in this group. More...
 
H5std_string getObjnameByIdx (hsize_t idx) const
 Returns the name of an object in this group, given the object's index. More...
 
ssize_t getObjnameByIdx (hsize_t idx, char *name, size_t size) const
 Retrieves the name of an object in this group, given the object's index. More...
 
ssize_t getObjnameByIdx (hsize_t idx, H5std_string &name, size_t size) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
H5O_type_t childObjType (const H5std_string &objname) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name. More...
 
H5O_type_t childObjType (const char *objname) const
 Returns the type of an object in this file/group, given the object's name. More...
 
H5O_type_t childObjType (hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char *objname=".") const
 Returns the type of an object in this file/group, given the object's index and its type and order. More...
 
unsigned childObjVersion (const char *objname) const
 Returns the object header version of an object in this file/group, given the object's name. More...
 
unsigned childObjVersion (const H5std_string &objname) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name. More...
 
H5G_obj_t getObjTypeByIdx (hsize_t idx) const
 
H5G_obj_t getObjTypeByIdx (hsize_t idx, char *type_name) const
 
H5G_obj_t getObjTypeByIdx (hsize_t idx, H5std_string &type_name) const
 
void getObjinfo (const char *name, hbool_t follow_link, H5G_stat_t &statbuf) const
 Returns information about an object. More...
 
void getObjinfo (const H5std_string &name, hbool_t follow_link, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void getObjinfo (const char *name, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't have the paramemter follow_link. More...
 
void getObjinfo (const H5std_string &name, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
int iterateElems (const char *name, int *idx, H5G_iterate_t op, void *op_data)
 Iterates a user's function over the entries of a group. More...
 
int iterateElems (const H5std_string &name, int *idx, H5G_iterate_t op, void *op_data)
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void link (H5L_type_t link_type, const char *curr_name, const char *new_name) const
 Creates a link of the specified type from new_name to curr_name. More...
 
void link (H5L_type_t link_type, const H5std_string &curr_name, const H5std_string &new_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for curr_name and new_name. More...
 
void unlink (const char *name) const
 Removes the specified name at this location. More...
 
void unlink (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void mount (const char *name, const H5File &child, const PropList &plist) const
 Mounts the file child onto this group. More...
 
void mount (const H5std_string &name, const H5File &child, const PropList &plist) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for name. More...
 
void unmount (const char *name) const
 Unmounts the specified file. More...
 
void unmount (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void move (const char *src, const char *dst) const
 Renames an object at this location. More...
 
void move (const H5std_string &src, const H5std_string &dst) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for src and dst. More...
 
DataType openDataType (const char *name) const
 Opens the named generic datatype at this location. More...
 
DataType openDataType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
ArrayType openArrayType (const char *name) const
 Opens the named array datatype at this location. More...
 
ArrayType openArrayType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
CompType openCompType (const char *name) const
 Opens the named compound datatype at this location. More...
 
CompType openCompType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
EnumType openEnumType (const char *name) const
 Opens the named enumeration datatype at this location. More...
 
EnumType openEnumType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
IntType openIntType (const char *name) const
 Opens the named integer datatype at this location. More...
 
IntType openIntType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
FloatType openFloatType (const char *name) const
 Opens the named floating-point datatype at this location. More...
 
FloatType openFloatType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
StrType openStrType (const char *name) const
 Opens the named string datatype at this location. More...
 
StrType openStrType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
VarLenType openVarLenType (const char *name) const
 Opens the named variable length datatype at this location. More...
 
VarLenType openVarLenType (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 

Static Public Member Functions

static bool isHdf5 (const char *name)
 Determines whether a file in HDF5 format. (Static) More...
 
static bool isHdf5 (const H5std_string &name)
 This is an overloaded member function, provided for convenience. It takes an H5std_string for name. (Static) More...
 
- Static Public Member Functions inherited from H5::IdComponent
static H5I_type_t getHDFObjType (const hid_t obj_id)
 Given an id, returns the type of the object. More...
 
static bool isValid (hid_t an_id)
 Checks if the given ID is valid. More...
 

Additional Inherited Members

- Protected Member Functions inherited from H5::H5Location
virtual ~H5Location ()
 Noop destructor. More...
 

Detailed Description

Modification: May 5, 2017: In the class rearrangement of 1.8.10, H5File should have been moved to inherit from Group instead, because HDF5 file is a root group. It is now done in 1.10 (Mar 30) and 1.8.19 releases. -BMR

Examples:
chunks.cpp, compound.cpp, create.cpp, extend_ds.cpp, h5group.cpp, readdata.cpp, and writedata.cpp.

Constructor & Destructor Documentation

H5::H5File::H5File ( const char *  name,
unsigned int  flags,
const FileCreatPropList create_plist = FileCreatPropList::DEFAULT,
const FileAccPropList access_plist = FileAccPropList::DEFAULT 
)
Parameters
name- IN: Name of the file
flags- IN: File access flags
create_plist- IN: File creation property list, used when modifying default file meta-data. Default to FileCreatPropList::DEFAULT
access_plist- IN: File access property list. Default to FileAccPropList::DEFAULT
Description
Valid values of flags include:
  • H5F_ACC_TRUNC - Truncate file, if it already exists, erasing all data previously stored in the file.
  • H5F_ACC_EXCL - Fail if file already exists. H5F_ACC_TRUNC and H5F_ACC_EXCL are mutually exclusive
  • H5F_ACC_RDONLY - Open file as read-only, if it already exists, and fail, otherwise
  • H5F_ACC_RDWR - Open file for read/write, if it already exists, and fail, otherwise
For info on file creation in the case of an already-open file, please refer to the Special case section in the C layer Reference Manual at: https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create
H5::H5File::H5File ( const H5std_string &  name,
unsigned int  flags,
const FileCreatPropList create_plist = FileCreatPropList::DEFAULT,
const FileAccPropList access_plist = FileAccPropList::DEFAULT 
)
Parameters
name- IN: Name of the file - H5std_string
flags- IN: File access flags
create_plist- IN: File creation property list, used when modifying default file meta-data. Default to FileCreatPropList::DEFAULT
access_plist- IN: File access property list. Default to FileAccPropList::DEFAULT
H5::H5File::H5File ( )
H5::H5File::H5File ( const H5File original)
Parameters
original- IN: H5File instance to copy

References getId(), and H5::IdComponent::incRefCount().

H5::H5File::~H5File ( )
virtual

Member Function Documentation

void H5::H5File::close ( )
virtual
Exceptions
H5::FileIException

Reimplemented from H5::Group.

Referenced by openFile(), reOpen(), and ~H5File().

virtual H5std_string H5::H5File::fromClass ( ) const
inlinevirtual

Reimplemented from H5::Group.

FileAccPropList H5::H5File::getAccessPlist ( ) const
Returns
FileAccPropList object
Exceptions
H5::FileIException
FileCreatPropList H5::H5File::getCreatePlist ( ) const
Returns
FileCreatPropList object
Exceptions
H5::FileIException
void H5::H5File::getFileInfo ( H5F_info_t &  file_info) const
Exceptions
H5::FileIException
Description
The retrieved information may include information about superblock extension, free space management, and shared object
hsize_t H5::H5File::getFileSize ( ) const
Returns
File size
Exceptions
H5::FileIException
Description
This function is called after an existing file is opened in order to learn the true size of the underlying file.
hssize_t H5::H5File::getFreeSpace ( ) const
Returns
Amount of free space
Exceptions
H5::FileIException
hid_t H5::H5File::getId ( ) const
virtual
Returns
File identifier

Reimplemented from H5::Group.

Examples:
h5group.cpp.

Referenced by H5File(), and H5::CommonFG::mount().

ssize_t H5::H5File::getObjCount ( unsigned  types = H5F_OBJ_ALL) const
Parameters
types- Type of object to retrieve the count
Returns
Number of opened object IDs
Exceptions
H5::FileIException
Description
The valid values for types include:
  • H5F_OBJ_FILE - Files only
  • H5F_OBJ_DATASET - Datasets only
  • H5F_OBJ_GROUP - Groups only
  • H5F_OBJ_DATATYPE - Named datatypes only
  • H5F_OBJ_ATTR - Attributes only
  • H5F_OBJ_ALL - All of the above, i.e., H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR
Multiple object types can be combined with the logical OR operator (|).
void H5::H5File::getObjIDs ( unsigned  types,
size_t  max_objs,
hid_t *  oid_list 
) const
Parameters
types- Type of object to retrieve the count
max_objs- Maximum number of object identifiers to place into obj_id_list.
oid_list- List of open object identifiers
Exceptions
H5::FileIException
Description
The valid values for types include:
  • H5F_OBJ_FILE - Files only
  • H5F_OBJ_DATASET - Datasets only
  • H5F_OBJ_GROUP - Groups only
  • H5F_OBJ_DATATYPE - Named datatypes only
  • H5F_OBJ_ATTR - Attributes only
  • H5F_OBJ_ALL - All of the above, i.e., H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR
Multiple object types can be combined with the logical OR operator (|).
void H5::H5File::getVFDHandle ( void **  file_handle) const
Parameters
file_handle- Pointer to the file handle being used by the low-level virtual file driver
Exceptions
H5::FileIException
void H5::H5File::getVFDHandle ( const FileAccPropList fapl,
void **  file_handle 
) const
Parameters
fapl- File access property list
file_handle- Pointer to the file handle being used by the low-level virtual file driver
Exceptions
H5::FileIException
Description
For the FAMILY or MULTI drivers, fapl should be defined through the property list functions: FileAccPropList::setFamilyOffset for the FAMILY driver and FileAccPropList::setMultiType for the 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.

References H5::PropList::getId().

bool H5::H5File::isHdf5 ( const char *  name)
static
Parameters
name- IN: Name of the file
Returns
true if the file is in HDF5 format, and false, otherwise
Exceptions
H5::FileIException

Referenced by isHdf5().

bool H5::H5File::isHdf5 ( const H5std_string &  name)
static
Parameters
name- IN: Name of the file - H5std_string

References isHdf5().

void H5::H5File::openFile ( const H5std_string &  name,
unsigned int  flags,
const FileAccPropList access_plist = FileAccPropList::DEFAULT 
)
Parameters
name- IN: Name of the file - H5std_string
flags- IN: File access flags
access_plist- IN: File access property list. Default to FileAccPropList::DEFAULT
void H5::H5File::openFile ( const char *  name,
unsigned int  flags,
const FileAccPropList access_plist = FileAccPropList::DEFAULT 
)
Parameters
name- IN: Name of the file
flags- IN: File access flags
access_plist- IN: File access property list. Default to FileAccPropList::DEFAULT
Description
Valid values of 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

References close(), H5::Exception::getDetailMsg(), and H5::PropList::getId().

void H5::H5File::reOpen ( )
void H5::H5File::throwException ( const H5std_string &  func_name,
const H5std_string &  msg 
) const
virtual
Parameters
func_name- Name of the function where failure occurs
msg- Message describing the failure
Exceptions
H5::FileIException

Reimplemented from H5::Group.


The documentation for this class was generated from the following files:


The HDF Group Help Desk:
  Copyright by The HDF Group
and the Board of Trustees of the University of Illinois