H5Part  1.6.6
Functions
Reading and Writing Attributes
H5Part C API

Functions

h5part_int64_t H5PartWriteFileAttribFloat32 (H5PartFile *f, const char *name, const h5part_float32_t value)
h5part_int64_t H5PartWriteFileAttribFloat64 (H5PartFile *f, const char *name, const h5part_float64_t value)
h5part_int64_t H5PartWriteFileAttribInt32 (H5PartFile *f, const char *name, const h5part_int32_t value)
h5part_int64_t H5PartWriteFileAttribInt64 (H5PartFile *f, const char *name, const h5part_int64_t value)
h5part_int64_t H5PartWriteStepAttribFloat32 (H5PartFile *f, const char *name, const h5part_float32_t value)
h5part_int64_t H5PartWriteStepAttribFloat64 (H5PartFile *f, const char *name, const h5part_float64_t value)
h5part_int64_t H5PartWriteStepAttribInt32 (H5PartFile *f, const char *name, const h5part_int32_t value)
h5part_int64_t H5PartWriteStepAttribInt64 (H5PartFile *f, const char *name, const h5part_int64_t value)
h5part_int64_t H5PartWriteFileAttribString (H5PartFile *f, const char *name, const char *value)
h5part_int64_t H5PartWriteStepAttribString (H5PartFile *f, const char *name, const char *value)
h5part_int64_t H5PartWriteStepAttrib (H5PartFile *f, const char *name, const h5part_int64_t type, const void *data, const h5part_int64_t nelem)
h5part_int64_t H5PartWriteFileAttrib (H5PartFile *f, const char *name, const h5part_int64_t type, const void *data, const h5part_int64_t nelem)
h5part_int64_t H5PartGetNumStepAttribs (H5PartFile *f)
h5part_int64_t H5PartGetNumFileAttribs (H5PartFile *f)
h5part_int64_t H5PartGetStepAttribInfo (H5PartFile *f, const h5part_int64_t attrib_idx, char *attrib_name, const h5part_int64_t len_of_attrib_name, h5part_int64_t *attrib_type, h5part_int64_t *attrib_nelem)
h5part_int64_t H5PartGetFileAttribInfo (H5PartFile *f, const h5part_int64_t attrib_idx, char *attrib_name, const h5part_int64_t len_of_attrib_name, h5part_int64_t *attrib_type, h5part_int64_t *attrib_nelem)
h5part_int64_t H5PartReadStepAttrib (H5PartFile *f, const char *attrib_name, void *attrib_value)
h5part_int64_t H5PartReadFileAttrib (H5PartFile *f, const char *attrib_name, void *attrib_value)

Function Documentation

h5part_int64_t H5PartGetFileAttribInfo ( H5PartFile *  f,
const h5part_int64_t  attrib_idx,
char *  attrib_name,
const h5part_int64_t  len_of_attrib_name,
h5part_int64_t *  attrib_type,
h5part_int64_t *  attrib_nelem 
)

Gets the name, type and number of elements of the file attribute specified by its index.

This function can be used to retrieve all attributes bound to the file f by looping from 0 to the number of attribute minus one. The number of attributes bound to file f can be queried by calling the function H5PartGetNumFileAttribs().

Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]attrib_idxIndex of attribute to get infos about
[out]attrib_nameName of attribute
[in]len_of_attrib_namelength of buffer name
[out]attrib_typeType of value.
[out]attrib_nelemNumber of elements
h5part_int64_t H5PartGetNumFileAttribs ( H5PartFile *  f)

Gets the number of attributes bound to the file.

Returns:
Number of attributes bound to file f or error code.
Parameters:
[in]fHandle to open file
h5part_int64_t H5PartGetNumStepAttribs ( H5PartFile *  f)

Gets the number of attributes bound to the current step.

Returns:
Number of attributes bound to current time step or error code.
Parameters:
[in]fHandle to open file
h5part_int64_t H5PartGetStepAttribInfo ( H5PartFile *  f,
const h5part_int64_t  attrib_idx,
char *  attrib_name,
const h5part_int64_t  len_of_attrib_name,
h5part_int64_t *  attrib_type,
h5part_int64_t *  attrib_nelem 
)

Gets the name, type and number of elements of the step attribute specified by its index.

This function can be used to retrieve all attributes bound to the current time-step by looping from 0 to the number of attribute minus one. The number of attributes bound to the current time-step can be queried by calling the function H5PartGetNumStepAttribs().

Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]attrib_idxIndex of attribute to get infos about
[out]attrib_nameName of attribute
[in]len_of_attrib_namelength of buffer name
[out]attrib_typeType of value.
[out]attrib_nelemNumber of elements
h5part_int64_t H5PartReadFileAttrib ( H5PartFile *  f,
const char *  attrib_name,
void *  attrib_value 
)

Reads an attribute bound to file f.

Returns:
H5PART_SUCCESS or error code
h5part_int64_t H5PartReadStepAttrib ( H5PartFile *  f,
const char *  attrib_name,
void *  attrib_value 
)

Reads an attribute bound to current time-step.

Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]attrib_nameName of attribute to read
[out]attrib_valueValue of attribute
h5part_int64_t H5PartWriteFileAttrib ( H5PartFile *  f,
const char *  name,
const h5part_int64_t  type,
const void *  data,
const h5part_int64_t  nelem 
)

Writes an attribute name with values in the array data of nelem elements to the file root ("/").

The type of data must ve specified using one of the folowing macros:

  • H5PART_FLOAT64 (for h5part_float64_t)
  • H5PART_FLOAT32 (for h5part_float32_t)
  • H5PART_INT64 (for h5part_int64_t)
  • H5PART_INT32 (for h5part_int32_t)
  • H5PART_CHAR (for char)
  • H5PART_STRING (for char*)
Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]nameName of attribute
[in]typeType of values
[in]dataArray of attribute values
[in]nelemNumber of array elements
h5part_int64_t H5PartWriteFileAttribFloat32 ( H5PartFile *  f,
const char *  name,
const h5part_float32_t  value 
)

Writes a value of type floating points (32-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteFileAttribFloat64 ( H5PartFile *  f,
const char *  name,
const h5part_float64_t  value 
)

Writes a value of type floating points (64-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteFileAttribInt32 ( H5PartFile *  f,
const char *  name,
const h5part_int32_t  value 
)

Writes a value of type integers (32-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteFileAttribInt64 ( H5PartFile *  f,
const char *  name,
const h5part_int64_t  value 
)

Writes a value of type integers (64-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteFileAttribString ( H5PartFile *  f,
const char *  name,
const char *  value 
)

}@

Writes an attribute name with the string value to the file root ("/").

Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]nameName of attribute to create
[in]valueValue of attribute
h5part_int64_t H5PartWriteStepAttrib ( H5PartFile *  f,
const char *  name,
const h5part_int64_t  type,
const void *  data,
const h5part_int64_t  nelem 
)

Writes an attribute name with values in the array data of nelem elements to the current timestep.

The type of data must ve specified using one of the folowing macros:

  • H5PART_FLOAT64 (for h5part_float64_t)
  • H5PART_FLOAT32 (for h5part_float32_t)
  • H5PART_INT64 (for h5part_int64_t)
  • H5PART_INT32 (for h5part_int32_t)
  • H5PART_CHAR (for char)
  • H5PART_STRING (for char*)
Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]nameName of attribute
[in]typeType of values
[in]dataArray of attribute values
[in]nelemNumber of array elements
h5part_int64_t H5PartWriteStepAttribFloat32 ( H5PartFile *  f,
const char *  name,
const h5part_float32_t  value 
)

Writes a value of type floating points (32-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteStepAttribFloat64 ( H5PartFile *  f,
const char *  name,
const h5part_float64_t  value 
)

Writes a value of type floating points (64-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteStepAttribInt32 ( H5PartFile *  f,
const char *  name,
const h5part_int32_t  value 
)

Writes a value of type integers (32-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteStepAttribInt64 ( H5PartFile *  f,
const char *  name,
const h5part_int64_t  value 
)

Writes a value of type integers (64-bit) to the root ("/") of the file as attribute name.

Returns:
H5PART_SUCCESS or error code
Parameters:
fIN: file handle
nameIN: attribute name
valueIN: attribute value
h5part_int64_t H5PartWriteStepAttribString ( H5PartFile *  f,
const char *  name,
const char *  value 
)

Writes an attribute name with the string value to the current timestep.

Returns:
H5PART_SUCCESS or error code
Parameters:
[in]fHandle to open file
[in]nameName of attribute to create
[in]valueValue of attribute