ddn.data.hdf5.file
HDF5 File Wrapper
This module provides a D wrapper for HDF5 file operations with RAII semantics for automatic resource management.
License
BSD-3-Clause
enum FileIntent
Types 3
enumFileIntent : uint
File intent flags indicating how the file was opened.
READ_ONLY = H5F_ACC.RDONLYFile is opened for read-only access
READ_WRITE = H5F_ACC.RDWRFile is opened for read-write access
structFileInfo
D-friendly structure containing comprehensive information about an HDF5 file.
This is a high-level wrapper around the HDF5 H5F_info2_t structure, providing information about the file's superblock, free space, and shared object header messages.
Fields
SuperblockInfo superblockSuperblock informationFreeSpaceInfo freeSpaceFree space manager informationSharedObjectInfo sharedObjectsShared object header message informationNested Templates
SuperblockInfoSuperblock information.FreeSpaceInfoFree space manager information.SharedObjectInfoShared object header message information.structFile
RAII wrapper for HDF5 file handles.
This struct manages an HDF5 file handle and automatically closes it when the struct goes out of scope. Copy is disabled to prevent double-close issues; use move() for transferring ownership.
Example:
// Create a new file
auto file = File.create("data.h5");
// Open an existing file
auto file2 = File.open("existing.h5", FileAccessMode.readOnly);Fields
private hid_t _idMethods
File create(string filename, FileCreateMode mode = FileCreateMode.truncate,
hid_t fcpl = H5P_DEFAULT, hid_t fapl = H5P_DEFAULT)Creates a new HDF5 file.File open(string filename, FileAccessMode mode = FileAccessMode.readOnly,
hid_t fapl = H5P_DEFAULT)Opens an existing HDF5 file.void close()Explicitly closes the file handle.void flush(H5F_scope_t scope_ = H5F_scope_t.GLOBAL)Flushes all buffers associated with the file to disk.hsize_t getFileSize()Gets the size of the file in bytes.string getFileName()Gets the file name.ptrdiff_t getObjectCount(uint types = H5F_OBJ.ALL)Gets the number of open object IDs in the file.hid_t getCreatePlist()Gets the file creation property list used when creating this file.hid_t getAccessPlist()Gets the file access property list used when opening this file.FileIntent getIntent()Gets the intent (access mode) the file was opened with.hssize_t getFreeSpace()Gets the amount of free space in the file.void mount(string mountPoint, ref File childFile, hid_t plist = H5P_DEFAULT)Mounts another HDF5 file at a specified location in this file.void unmount(string mountPoint)Unmounts a previously mounted file from the specified location.void startSwmrWrite()Enables SWMR (Single Writer Multiple Reader) write mode for the file.Destructors
~thisDestructor that automatically closes the file handle.