summaryrefslogtreecommitdiffstats
path: root/c++/src/H5StrType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-12-05 20:23:12 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-12-05 20:23:12 (GMT)
commit11d013f8ccd95d7a5511260fad585ea6a039eac4 (patch)
treeda7c8eff13f9d09d1a96456da8935d346920df66 /c++/src/H5StrType.cpp
parente969226fc701d06fc3e6e4b312c6bd77395b76d3 (diff)
downloadhdf5-11d013f8ccd95d7a5511260fad585ea6a039eac4.zip
hdf5-11d013f8ccd95d7a5511260fad585ea6a039eac4.tar.gz
hdf5-11d013f8ccd95d7a5511260fad585ea6a039eac4.tar.bz2
[svn-r11762] Purpose: Adding more wrappers
Description: Added member function H5File::openFile and overloaded for convenience. Added overloaded getObjinfo to skip the middle parameter. Changed StrType(const size_t& size); to StrType(const int dummy, const size_t& size); because the first one clashed with StrType(const hid_t existing_id); Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) HPUX 11.00 (kelgia)
Diffstat (limited to 'c++/src/H5StrType.cpp')
-rw-r--r--c++/src/H5StrType.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index 68b91fd..f76406a 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -62,20 +62,21 @@ StrType::StrType( const PredType& pred_type ) : AtomType()
//--------------------------------------------------------------------------
// Function: StrType overloaded constructor
///\brief Creates a string datatype with a specified length
-///\param existing_id - IN: Id of an existing datatype
+///\param pred_type - IN: String predefined type to replicate.
+///\param size - IN: Length of the new string type
///\exception H5::DataTypeIException
// Description
// The 1st argument could have been skipped, but this
// constructor will collide with the one that takes an
// existing id.
//
-// Update: by passing 'size' by reference will avoid the
-// clashing problem, so the 1st argument can actually be
-// omitted. This constructor should be replaced by the
-// other after announcing. - May, 2004
+// Update: replacing the 1st argument with a dummy 0 to
+// avoid the clashing problem, that doesn't eliminate the
+// the 1st argument but it's simpler for the user to type
+// a '0' than PredType::C_S1. - Dec 2, 2005
///\note
-/// This constructor will be obsolete in later releases,
-/// please use StrType( const size_t& size ) instead.
+/// The use of this constructor can be shortened by using
+/// its overloaded below as StrType(0, size).
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType()
@@ -85,7 +86,24 @@ StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType()
copy(pred_type);
setSize(size);
}
-StrType::StrType( const size_t& size ) : AtomType()
+
+//--------------------------------------------------------------------------
+// Function: StrType overloaded constructor
+///\brief Creates a string datatype with a specified length
+///\param dummy - IN: To simplify calling the previous constructor
+// and avoid prototype clash with another constructor
+///\param size - IN: Length of the new string type
+///\exception H5::DataTypeIException
+///\par 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.
+// Programmer Binh-Minh Ribler - Nov 28, 2005
+//--------------------------------------------------------------------------
+StrType::StrType( const int dummy, const size_t& size ) : AtomType()
{
// use DataType::copy to make a copy of the string predefined type
// then set its length
@@ -110,7 +128,7 @@ StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {}
StrType::StrType( const StrType& original ) : AtomType ( original ) {}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
+// Function: StrType overloaded constructor
///\brief Gets the string datatype of the specified dataset
///\param dataset - IN: Dataset that this string datatype associates with
///\exception H5::DataTypeIException