diff options
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 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 |