Public Types | Public Member Functions | Friends

Hdf_file Class Reference

#include <Hdf_file.hpp>

List of all members.

Public Types

typedef Hdf_sds::sds_infos_type sds_infos_type

Public Member Functions

 Hdf_file (const char *filename, int32 access, std::vector< sds_infos_type > sds_infos=std::vector< sds_infos_type >(), int32 fill_mode=SD_FILL, int32 compression_type=COMP_CODE_NONE, int32 compression_level=DEFAULT_COMP_LEVEL)
 Hdf_file (const char *filename, int32 access, Hdf_file::sds_infos_type *sds_infos, const size_t nsds, int32 fill_mode=SD_FILL, int32 compression_type=COMP_CODE_NONE, int32 compression_level=DEFAULT_COMP_LEVEL)
 Hdf_file (const char *filename, int32 access, int32 n_sds_array, Hdf_sds *sds_array, int32 fill_mode=SD_FILL, int32 compression_type=COMP_CODE_NONE, int32 compression_level=DEFAULT_COMP_LEVEL)
 Hdf_file (const Hdf_file &hdf_file)
Hdf_fileoperator= (const Hdf_file &hdf_file)
std::string to_string () const
int32 get_n_file_attrs () const
bool has_attr (const char *file_attr) const
Hdf_attr get_attr (const char *file_attr) const
std::string list_of_attributes (const int32 chars_to_display=80, const int32 numbers_to_display=10) const
void set_file_attr (const char *attr_name, const int val_type, const int32 val_length, VOIDP attr_val)
std::string get_filename () const
int32 get_sd_id () const
int32 get_n_sds () const
Hdf_sds get_sds (const char *sds_name) const
Hdf_sds get_sds (const int32 &sds_index) const
std::string get_sds_name (const int32 &sds_index)
const int32 get_sds_id (const char *sds_name)
const int32 get_sds_index (const char *sds_name)
const intn append_sds (const sds_infos_type &sds_infos, const void *sds_data)
 write an sds to the file
const int32 create_sds (const sds_infos_type &sds_infos)
 create an sds and return its id
const int32 get_sds_data_type (const char *sds_name)
 access to the type of datas of a sds
const size_t get_sds_sizeof (const char *sds_name)
 access to the memory size of the type of an sds' datas It returns the memory size in bytes using sizeof convention
void get_sds_array (Hdf_sds *sds_array)
void get_fill_value (const char *sds_name, void *fill_value)
void set_fill_value (const char *sds_name, void *fill_value)
void set_sds (int32 sds_index, Hdf_sds sds)
Hdf_sds read_sds (const char *sds_name, void *sds_data=NULL, int32 *start=NULL, int32 *stride=NULL, int32 *edges=NULL)
Hdf_sds read_sds (const int32 sds_index, void *sds_data=NULL, int32 *start=NULL, int32 *stride=NULL, int32 *edges=NULL)
void write_sds (const char *sds_name, const void *sds_data, int32 *start, int32 *stride, int32 *edges, float64 cal=0., float64 offset=0., float64 cal_err=0., float64 off_err=0.)
void write_sds (const int32 sds_index, const void *sds_data, int32 *start, int32 *stride, int32 *edges, float64 cal=0., float64 offset=0., float64 cal_err=0., float64 off_err=0.)
std::string list_of_sds () const
void set_sds_attr (const int32 sds_index, const char *attr_name, const int val_type, const int32 val_length, VOIDP attr_val)
void set_sds_attr (const char *sds_name, const char *attr_name, const int val_type, const int32 val_length, VOIDP attr_val)
void get_sds_attr (const char *sds_name, const char *attr_name, void *value, const int32 ival=0) const
void get_calibration (const char *sds_name, float64 &cal, float64 &cal_error, float64 &offset, float64 &offset_err, int32 &data_type)
int32 get_n_vd () const
 retrieve the number of VData in the file
Hdf_vd get_vd (const char *vd_name) const
Hdf_vd get_vd (const int32 &vd_index) const
const bool has_vd (const char *vd_name) const
 test the existence of the vd
const int32 get_vd_field_data_type (const char *vd_name, const char *vd_field_name)
 read the data type of a VData field
void set_vd_attr (const int32 vd_index, const char *attr_name, const int val_type, const int32 val_length, VOIDP attr_val)
void set_vd_attr (const char *vd_name, const char *attr_name, const int val_type, const int32 val_length, VOIDP attr_val)
void get_vd_attr (const char *vd_name, const char *attr_name, void *value, const int32 ival=0) const
std::string list_of_vdata () const
Hdf_vd_field read_vdata_field (const char *vd_name="", const char *vd_field_name="", void *data=NULL, int32 start=0, int32 edges=-1)
 read the datas of one VData field. If you let the start and edge values at their default, all the datas will be read
const bool is_vs_interface_opened ()
int32 open_vs_interface (int32 access=DFACC_READ)
void close_vs_interface ()

Friends

std::ostream & operator<< (std::ostream &stream, const Hdf_file &hdf_file)

Detailed Description

Warning:
the VData and VData fields read attributes capabilities haven't been fully tested because of the lack of files using it.

Member Function Documentation

const intn Hdf_file::append_sds ( const sds_infos_type sds_infos,
const void *  sds_data 
)

write an sds to the file

Parameters:
sds_infos structure describing the SDS and its attributes
sds_data data buffer to write
Returns:
FAIL if an error occured, SUCCESS else
const int32 Hdf_file::create_sds ( const sds_infos_type sds_infos  ) 

create an sds and return its id

Parameters:
sds_infos structure describing the SDS
Returns:
FAIL if an error occured, the SDS ID else
int32 Hdf_file::get_n_vd (  )  const [inline]

retrieve the number of VData in the file

Returns:
the number of VData
const int32 Hdf_file::get_sds_data_type ( const char *  sds_name  ) 

access to the type of datas of a sds

Parameters:
sds_name the name of the sds
Returns:
the HDF type code of the sds datas
const size_t Hdf_file::get_sds_sizeof ( const char *  sds_name  ) 

access to the memory size of the type of an sds' datas It returns the memory size in bytes using sizeof convention

Parameters:
sds_name the name of the sds
Returns:
the size of one element of this sds
const int32 Hdf_file::get_vd_field_data_type ( const char *  vd_name,
const char *  vd_field_name 
)

read the data type of a VData field

Parameters:
vd_name name of the VData
vd_field_name name of the VData Field
Returns:
the VDATA field datatype, using the HDF typecode convention

References Hdf_vd::get_field().

const bool Hdf_file::has_vd ( const char *  vd_name  )  const

test the existence of the vd

Parameters:
vd_name the name of the vd
Returns:
true if the vd has been found
Hdf_vd_field Hdf_file::read_vdata_field ( const char *  vd_name = "",
const char *  vd_field_name = "",
void *  data = NULL,
int32  start = 0,
int32  edges = -1 
)

read the datas of one VData field. If you let the start and edge values at their default, all the datas will be read

Parameters:
vd_name the name of the VData
vd_field_name the name of the field to read
data the data's output buffer. Must be already allocated
start the start of reading index
edges the number of values to read
Returns:
the read field
Warning:
Only one VData field datas can be read read at one time.
The case of reading values in a multi-order field hasn't been tested yet

The documentation for this class was generated from the following files: