diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2014-04-17 23:25:01 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2014-04-17 23:25:01 (GMT) |
commit | a75e8dd654268ba1dd35abf3a78da2f115802029 (patch) | |
tree | 55ce2f23d860187f021d11c3611fa43c314eff6b /c++/src/H5Attribute.cpp | |
parent | ca6e13d3dff9c188d80cb84876cf3ccfeb6b6203 (diff) | |
download | hdf5-a75e8dd654268ba1dd35abf3a78da2f115802029.zip hdf5-a75e8dd654268ba1dd35abf3a78da2f115802029.tar.gz hdf5-a75e8dd654268ba1dd35abf3a78da2f115802029.tar.bz2 |
[svn-r25061] Description:
Put back overloaded functions for backward compatibility:
- were replaced by better prototyped versions, such as Attribute::getName.
- were modified to add const to constant arguments.
Added notes for future removal in documentation.
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.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 204535e..bdd0ac0 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 |