@@ -5,8 +5,8 @@ use std::ptr::{self, addr_of_mut};
55use std:: str:: FromStr ;
66
77use hdf5_sys:: h5p:: {
8- H5Pcopy , H5Pequal , H5Pexist , H5Pget_class , H5Pget_class_name , H5Pget_nprops , H5Piterate ,
9- H5Pset_vlen_mem_manager ,
8+ H5Pcopy , H5Pequal , H5Pexist , H5Pget_class , H5Pget_class_name , H5Pget_nprops , H5Pisa_class ,
9+ H5Piterate , H5Pset_vlen_mem_manager ,
1010} ;
1111
1212use crate :: internal_prelude:: * ;
@@ -208,6 +208,33 @@ impl PropertyList {
208208 PropertyListClass :: from_str( & name)
209209 } )
210210 }
211+
212+ pub fn is_class ( & self , class : PropertyListClass ) -> bool {
213+ use crate :: globals:: * ;
214+ h5lock ! ( {
215+ let class = match class {
216+ PropertyListClass :: FileCreate => * H5P_FILE_CREATE ,
217+ PropertyListClass :: AttributeCreate => * H5P_ATTRIBUTE_CREATE ,
218+ PropertyListClass :: DatasetAccess => * H5P_DATASET_ACCESS ,
219+ PropertyListClass :: DatasetCreate => * H5P_DATASET_CREATE ,
220+ PropertyListClass :: DataTransfer => * H5P_DATASET_XFER ,
221+ PropertyListClass :: DatatypeAccess => * H5P_DATATYPE_ACCESS ,
222+ PropertyListClass :: DatatypeCreate => * H5P_DATATYPE_CREATE ,
223+ PropertyListClass :: FileAccess => * H5P_FILE_ACCESS ,
224+ PropertyListClass :: FileMount => * H5P_FILE_MOUNT ,
225+ PropertyListClass :: GroupAccess => * H5P_GROUP_ACCESS ,
226+ PropertyListClass :: GroupCreate => * H5P_GROUP_CREATE ,
227+ PropertyListClass :: LinkAccess => * H5P_LINK_ACCESS ,
228+ PropertyListClass :: LinkCreate => * H5P_LINK_CREATE ,
229+ PropertyListClass :: ObjectCopy => * H5P_OBJECT_COPY ,
230+ PropertyListClass :: ObjectCreate => * H5P_OBJECT_CREATE ,
231+ PropertyListClass :: StringCreate => * H5P_STRING_CREATE ,
232+ } ;
233+ let tri = H5Pisa_class ( self . id( ) , class) ;
234+
235+ tri == 1
236+ } )
237+ }
211238}
212239
213240/// Set the memory manager for variable length items to
0 commit comments