23 #if !defined (octave_ls_hdf5_h)
24 #define octave_ls_hdf5_h 1
26 #if defined (HAVE_HDF5)
51 : file_id (-1), current_item (-1)
53 if (mode & std::ios::in)
54 file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT);
55 else if (mode & std::ios::out)
57 if (mode & std::ios::app && H5Fis_hdf5 (name) > 0)
58 file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT);
60 file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT,
64 std::ios::setstate (std::ios::badbit);
73 if (H5Fclose (file_id) < 0)
74 std::ios::setstate (std::ios::badbit);
79 void open (
const char *name,
int mode,
int)
83 if (mode & std::ios::in)
84 file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT);
85 else if (mode & std::ios::out)
87 if (mode & std::ios::app && H5Fis_hdf5 (name) > 0)
88 file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT);
90 file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT,
94 std::ios::setstate (std::ios::badbit);
113 void open (
const char *name,
int mode = std::ios::in|std::ios::binary,
128 void open (
const char *name,
int mode = std::ios::out|std::ios::binary,
139 : name (), global (false), tc (), doc () { }
156 #if HAVE_HDF5_INT2FLOAT_CONVERSIONS
172 const std::string& name,
const std::string& doc,
173 bool mark_as_global,
bool save_as_floats);
182 read_hdf5_data (std::istream& is,
const std::string& filename,
bool& global,
188 const std::string& name,
const std::string& doc,
189 bool mark_as_global,
bool save_as_floats);
204 const char *attr_name,
void *buf);
206 #ifdef USE_64_BIT_IDX_T
207 #define H5T_NATIVE_IDX H5T_NATIVE_INT64
209 #define H5T_NATIVE_IDX H5T_NATIVE_INT
static void clear(octave_shlib &oct_file)
OCTINTERP_API int load_hdf5_empty(hid_t loc_id, const char *name, dim_vector &d)
OCTINTERP_API bool save_hdf5_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_as_global, bool save_as_floats)
OCTINTERP_API hid_t hdf5_make_complex_type(hid_t num_type)
OCTINTERP_API herr_t hdf5_add_scalar_attr(hid_t loc_id, hid_t type_id, const char *attr_name, void *buf)
OCTINTERP_API std::string read_hdf5_data(std::istream &is, const std::string &filename, bool &global, octave_value &tc, std::string &doc, const string_vector &argv, int argv_idx, int argc)
OCTINTERP_API bool add_hdf5_data(hid_t loc_id, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_as_global, bool save_as_floats)
OCTINTERP_API bool hdf5_types_compatible(hid_t t1, hid_t t2)
OCTINTERP_API int save_hdf5_empty(hid_t loc_id, const char *name, const dim_vector d)
void open(const char *name, int mode=std::ios::in|std::ios::binary, int prot=0)
hdf5_ofstream(const char *name, int mode=std::ios::out|std::ios::binary, int prot=0)
F77_RET_T const double const double double * d
hdf5_ifstream(const char *name, int mode=std::ios::in|std::ios::binary, int prot=0)
void open(const char *name, int mode=std::ios::out|std::ios::binary, int prot=0)
OCTINTERP_API herr_t hdf5_add_attr(hid_t loc_id, const char *attr_name)
OCTINTERP_API bool hdf5_check_attr(hid_t loc_id, const char *attr_name)
OCTINTERP_API bool hdf5_get_scalar_attr(hid_t loc_id, hid_t type_id, const char *attr_name, void *buf)
hdf5_fstreambase(const char *name, int mode, int=0)
OCTINTERP_API herr_t hdf5_read_next_data(hid_t group_id, const char *name, void *dv)
void open(const char *name, int mode, int)