diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2002-03-01 19:01:23 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2002-03-01 19:01:23 (GMT) |
commit | 3f4184c6d3795acad440206f0bd88d89df21a137 (patch) | |
tree | 7017603819b61ff5983d028beffdd7b550f55d1f /c++/src/H5PropList.cpp | |
parent | 2a576e3f851278339b3ae1a3b9ffbca8ab9f2f00 (diff) | |
download | hdf5-3f4184c6d3795acad440206f0bd88d89df21a137.zip hdf5-3f4184c6d3795acad440206f0bd88d89df21a137.tar.gz hdf5-3f4184c6d3795acad440206f0bd88d89df21a137.tar.bz2 |
[svn-r5029]
Purpose:
Adding new member function
Description:
Added PropList::copyProp according to the new api H5Pcopy_prop
in the C library. I'm still working on adding more tests so
test for this will be added as well.
Platforms tested:
SunOS 5.7 (arabica)
Linux 6.2 (eirene)
FreeBSD 4.4 (sleipnir)
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r-- | c++/src/H5PropList.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c489983..7adfda8 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -77,15 +77,31 @@ PropList& PropList::operator=( const PropList& rhs ) return(*this); } +// Copies a property from one list or class to another +void PropList::copyProp( PropList& dest, PropList& src, const string& name ) +{ + copyProp( dest, src, name.c_str()); +} + +// Copies a property from one list or class to another +void PropList::copyProp( PropList& dest, PropList& src, const char *name ) +{ + hid_t dst_id = dest.getId(); + hid_t src_id = src.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); + if( ret_value < 0 ) + { + throw PropListIException("PropList::copyProp", "H5Pcopy_prop failed"); + } + +} + // Closes the property list if it is not a default one void PropList::p_close() const { if( id != H5P_NO_CLASS ) // not a constant, should call H5Pclose { - herr_t ret_value; - - ret_value = H5Pclose( id ); - + herr_t ret_value = H5Pclose( id ); if( ret_value < 0 ) { throw PropListIException(NULL, "property list close failed" ); |