summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-18 04:46:27 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-18 04:46:27 (GMT)
commitd15b6b8d63b44c09a82ae020ca6d574f277289c7 (patch)
treef37a1d5895da9a05969f25db226fb084cf4bb53f /c++/src/H5DataType.cpp
parent458584b6b2385e53645a458aedea0037430b9bf2 (diff)
downloadhdf5-d15b6b8d63b44c09a82ae020ca6d574f277289c7.zip
hdf5-d15b6b8d63b44c09a82ae020ca6d574f277289c7.tar.gz
hdf5-d15b6b8d63b44c09a82ae020ca6d574f277289c7.tar.bz2
[svn-r8537] Purpose:
Add more C++ wrapper - incrementally check-in Description: Added wrapper for H5Tis_variable_str to DataType class. Tests for the new wrappers will follow in a few weeks. Platforms: SunOS 5.7 (arabica) Linux 2.4 (eirene) Windows 2000 Misc. update:
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r--c++/src/H5DataType.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index dbe7801..867eb4e 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -507,6 +507,28 @@ bool DataType::detectClass(H5T_class_t cls) const
}
//--------------------------------------------------------------------------
+// Function: DataType::isVariableStr
+///\brief Check whether this datatype is a variable-length string.
+///\return true if this datatype is a variable-length string, and
+/// false, otherwise.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May, 2004
+//--------------------------------------------------------------------------
+bool DataType::isVariableStr() const
+{
+ htri_t is_varlen_str = H5Tis_variable_str(id);
+ if( is_varlen_str == 1 )
+ return true;
+ else if( is_varlen_str == 0 )
+ return false;
+ else
+ {
+ throw DataTypeIException("DataType::isVariableStr",
+ "H5Tis_variable_str returns negative value");
+ }
+}
+
+//--------------------------------------------------------------------------
// This private function calls the C API H5Tclose to close this datatype.
// Used by H5Object::p_reset.
// Programmer Binh-Minh Ribler - 2000