diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-12 19:46:06 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-12 19:46:06 (GMT) |
commit | c7b27a76749fa0c299fd33299ac59b36348ada5f (patch) | |
tree | fc76e85d0e10252df420cee6ecf7bcc74b288560 /c++/src/H5DataType.cpp | |
parent | ff2c10c3f0f2174545e608dfbf668a05ad8d0f10 (diff) | |
download | hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.zip hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.tar.gz hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.tar.bz2 |
New overloaded functions and tests
Description:
- Added VarLenType::VarLenType(const DataType& base_type)
- Marked VarLenType::VarLenType(const DataType* base_type) deprecated
- Added a static wrapper for H5Tdetect_class for PredType
static bool DataType::detectClass(const PredType& pred_type, ...)
- Removed the deprecated function Exception::printError() from code
- Miscellaneous improvements in comments
- Added test functions test_detect_type_class() and test_vltype()
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (jelly)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r-- | c++/src/H5DataType.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 28a670e..90211b9 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -797,6 +797,28 @@ bool DataType::detectClass(H5T_class_t cls) const } //-------------------------------------------------------------------------- +// Function: DataType::detectClass (static) +///\brief Checks whether a predtype is a certain class of datatype. +///\return true if this predtype is the specified type class, and false, +/// otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - August, 2017 +//-------------------------------------------------------------------------- +bool DataType::detectClass(const PredType& pred_type, H5T_class_t cls) +{ + htri_t ret_value = H5Tdetect_class(pred_type.getId(), cls); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else + { + throw DataTypeIException("detectClass on PredType", + "H5Tdetect_class returns negative value"); + } +} + +//-------------------------------------------------------------------------- // Function: DataType::isVariableStr ///\brief Check whether this datatype is a variable-length string. ///\return true if this datatype is a variable-length string, and |