summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Attribute.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-04-18 02:39:50 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-04-18 02:39:50 (GMT)
commit19125219cdc58a1668ff46e572126c1c3e7c4f0b (patch)
tree923145058c721f49025f7d3a800e56abbd2b5107 /c++/src/H5Attribute.cpp
parent33fd0f8ce250c4c34c1259b21aa9aea716d6fefc (diff)
downloadhdf5-19125219cdc58a1668ff46e572126c1c3e7c4f0b.zip
hdf5-19125219cdc58a1668ff46e572126c1c3e7c4f0b.tar.gz
hdf5-19125219cdc58a1668ff46e572126c1c3e7c4f0b.tar.bz2
[svn-r25062] Description:
Put back overloaded functions for backward compatibility: - were replaced by better prototyped versions, such as Attribute::getNam. - were modified to add const to constant arguments. Added notes for future removal in documentation. (Elena approved.) Merged from trunk r25061. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu)
Diffstat (limited to 'c++/src/H5Attribute.cpp')
-rw-r--r--c++/src/H5Attribute.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index e119adc..1182b69 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -379,6 +379,27 @@ H5std_string Attribute::getName() const
//--------------------------------------------------------------------------
// Function: Attribute::getName
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an integer
+/// specifying a desired length to be retrieved of the name.
+///\return Name (or part of name) of the attribute
+///\param len - IN: Desired length of the name
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
+// Modification
+// Mar 2014 - BMR
+// Revised to use the new getName() below
+//--------------------------------------------------------------------------
+H5std_string Attribute::getName(size_t len) const
+{
+ H5std_string attr_name;
+ ssize_t name_size = getName(attr_name, len);
+ return(attr_name);
+ // let caller catch exception if any
+}
+
+//--------------------------------------------------------------------------
+// Function: Attribute::getName
///\brief Gets the name of this attribute, returning its length.
///\param attr_name - OUT: Buffer for the name string as \a H5std_string
///\param len - IN: Desired length of the name, default to 0
@@ -391,7 +412,8 @@ H5std_string Attribute::getName() const
// Programmer Binh-Minh Ribler - Nov, 2001
// Modification
// Mar 2014 - BMR
-// Revised to allow the argument "len" to be skipped
+// Added to replace getName(size_t, H5std_string&) so that it'll
+// allow the argument "len" to be skipped.
//--------------------------------------------------------------------------
ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
{
@@ -425,6 +447,24 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
}
//--------------------------------------------------------------------------
+// Function: Attribute::getName
+///\brief This function is replaced by the previous function, which
+/// provides more convenient prototype. It will be removed
+/// in future release.
+///\param len - IN: Desired length of the name
+///\param attr_name - OUT: Buffer for the name string
+///\return Actual length of the attribute name
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Nov, 2001
+// Modification
+// Modified to call its replacement. -BMR, 2014/04/16
+//--------------------------------------------------------------------------
+ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const
+{
+ return (getName(attr_name, len));
+}
+
+//--------------------------------------------------------------------------
// Function: Attribute::getStorageSize
///\brief Returns the amount of storage size required for this attribute.
///\return Size of the storage or 0, for no data