[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)
This commit is contained in:
Binh-Minh Ribler 2002-03-01 14:01:23 -05:00
parent 2a576e3f85
commit 3f4184c6d3
2 changed files with 24 additions and 4 deletions

View File

@ -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" );

View File

@ -28,6 +28,10 @@ class __DLLCPP__ PropList : public IdComponent {
// Make a copy of the given property list using assignment statement
PropList& operator=( const PropList& rhs );
// Copies a property from one property list or property class to another
void copyProp( PropList& dest, PropList& src, const string& name);
void copyProp( PropList& dest, PropList& src, const char* name);
// Gets the class of this property list, i.e. H5P_FILE_CREATE,
// H5P_FILE_ACCESS, ...
hid_t getClass() const;