diff options
Diffstat (limited to 'c++/src/H5StrType.cpp')
-rw-r--r-- | c++/src/H5StrType.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index d5fb744..cbb2103 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -181,6 +181,27 @@ StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy } //-------------------------------------------------------------------------- +// Function: StrType::decode +///\brief Returns an StrType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* StrType::decode() const +{ + hid_t encoded_strtype_id; + try { + encoded_strtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + StrType *encoded_strtype = new StrType; + encoded_strtype->p_setId(encoded_strtype_id); + return(encoded_strtype); +} + +//-------------------------------------------------------------------------- // Function: StrType::getCset ///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: |