Public Member Functions

H5::StrType Class Reference

List of all members.

Public Member Functions


Constructor & Destructor Documentation

H5::StrType::StrType ( const PredType pred_type  ) 

Creates a string datatype using a predefined type.

Parameters:
pred_type - IN: Predefined datatype
Exceptions:
H5::DataTypeIException 

References H5::DataType::copy().

H5::StrType::StrType ( const PredType pred_type,
const size_t &  size 
)

Creates a string datatype with a specified length.

Parameters:
pred_type - IN: String predefined type to replicate.
size - IN: Length of the new string type
Exceptions:
H5::DataTypeIException 
Note:
The use of this constructor can be shortened by using its overloaded below as StrType(0, size).

References H5::DataType::copy(), and H5::AtomType::setSize().

H5::StrType::StrType ( const int  dummy,
const size_t &  size 
)

Creates a string datatype with a specified length.

Parameters:
dummy - IN: To simplify calling the previous constructor and avoid prototype clash with another constructor
size - IN: Length of the new string type
Exceptions:
H5::DataTypeIException 
Description
The 1st argument is just a dummy to simplify calling the previous constructor, such as: StrType atype(0, size) instead of StrType atype(PredType::C_S1, size)
Note:
This constructor may replace the previous one in the future.

References H5::DataType::copy(), and H5::AtomType::setSize().

H5::StrType::StrType ( const DataSet dataset  ) 

Gets the string datatype of the specified dataset.

Parameters:
dataset - IN: Dataset that this string datatype associates with
Exceptions:
H5::DataTypeIException 

References H5::DataSet::getId().

H5::StrType::StrType ( const hid_t  existing_id  ) 

Creates an StrType object using the id of an existing datatype.

Parameters:
existing_id - IN: Id of an existing datatype
Exceptions:
H5::DataTypeIException 

Member Function Documentation

H5T_cset_t H5::StrType::getCset (  )  const

Retrieves the character set type of this string datatype.

Returns:
Character set type, which can be:
  • H5T_CSET_ASCII (0) - Character set is US ASCII.
Exceptions:
H5::DataTypeIException 
H5T_str_t H5::StrType::getStrpad (  )  const

Retrieves the storage mechanism for of this string datatype.

Returns:
String storage mechanism, which can be:
  • H5T_STR_NULLTERM (0) - Null terminate (as C does)
  • H5T_STR_NULLPAD (0) - Pad with zeros
  • H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does)
Exceptions:
H5::DataTypeIException 
void H5::StrType::setCset ( H5T_cset_t  cset  )  const

Sets character set to be used.

Parameters:
cset - IN: character set type, which can be:

  • H5T_CSET_ASCII (0) - Character set is US ASCII.
Exceptions:
H5::DataTypeIException 
void H5::StrType::setStrpad ( H5T_str_t  strpad  )  const

Defines the storage mechanism for this string datatype.

Parameters:
strpad - IN: String padding type
Exceptions:
H5::DataTypeIException 
Description
For detail, please refer to the C layer Reference Manual at: http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad