Skip to content

Commit

Permalink
Consolidate methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert committed Oct 7, 2020
1 parent d5ff7bb commit 7c6d128
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,11 @@ ishdf5(name::AbstractString) = h5f_is_hdf5(name)

# Extract the file
file(f::HDF5File) = f
file(g::HDF5Group) = g.file
file(dset::HDF5Dataset) = dset.file
file(dtype::HDF5Datatype) = dtype.file
file(a::HDF5Attribute) = a.file
file(o::Union{HDF5Object,HDF5Attribute}) = o.file
fd(obj::HDF5Object) = h5i_get_file_id(checkvalid(obj).id)

# Flush buffers
flush(f::Union{HDF5Object, HDF5Attribute, HDF5Datatype, HDF5File}, scope) = h5f_flush(checkvalid(f).id, scope)
flush(f::Union{HDF5Object, HDF5Attribute, HDF5Datatype, HDF5File}) = flush(f, H5F_SCOPE_GLOBAL)
flush(f::Union{HDF5Object, HDF5Attribute, HDF5Datatype, HDF5File}, scope = H5F_SCOPE_GLOBAL) = h5f_flush(checkvalid(f).id, scope)

# Open objects
g_open(parent::Union{HDF5File, HDF5Group}, name::String, apl::HDF5Properties=DEFAULT_PROPERTIES) = HDF5Group(h5g_open(checkvalid(parent).id, name, apl.id), file(parent))
Expand Down

0 comments on commit 7c6d128

Please sign in to comment.