summaryrefslogtreecommitdiffstats
path: root/c++/src/H5EnumType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5EnumType.cpp')
-rw-r--r--c++/src/H5EnumType.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index 2b614a9..a9f0b41 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -15,6 +15,7 @@
#include <string>
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -31,7 +32,6 @@
#include "H5AtomType.h"
#include "H5IntType.h"
#include "H5EnumType.h"
-#include "H5private.h" // for HDmemset
namespace H5 {
@@ -109,6 +109,42 @@ EnumType::EnumType( const IntType& data_type ) : DataType()
}
//--------------------------------------------------------------------------
+// Function: EnumType overloaded constructor
+///\brief Creates an EnumType instance by opening an HDF5 enum datatype
+/// given its name, provided as a C character string.
+///\param dtype_name - IN: Enum datatype name
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Dec 2016
+// Description
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openEnumType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
+//--------------------------------------------------------------------------
+EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType()
+{
+ id = p_opentype(loc, dtype_name);
+}
+
+//--------------------------------------------------------------------------
+// Function: EnumType overloaded constructor
+///\brief Creates an EnumType instance by opening an HDF5 enum datatype
+/// given its name, provided as an \c H5std_string.
+///\param dtype_name - IN: Enum datatype name
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Dec 2016
+// Description
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openEnumType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
+//--------------------------------------------------------------------------
+EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
+{
+ id = p_opentype(loc, dtype_name.c_str());
+}
+
+//--------------------------------------------------------------------------
// Function: EnumType::insert
///\brief Inserts a new member to this enumeration datatype.
///\param name - IN: Name of the new member