diff options
Diffstat (limited to 'c++/src/H5AtomType.cpp')
-rw-r--r-- | c++/src/H5AtomType.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 902d07c..c8c38e9 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -73,15 +73,14 @@ void AtomType::setSize( size_t size ) const //-------------------------------------------------------------------------- // Function: AtomType::getOrder ///\brief Returns the byte order of an atomic datatype. -///\param order_string - OUT: Text description of the returned byte order ///\return Byte order, which can be: /// \li \c H5T_ORDER_LE /// \li \c H5T_ORDER_BE /// \li \c H5T_ORDER_VAX ///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- -H5T_order_t AtomType::getOrder( string& order_string ) const +H5T_order_t AtomType::getOrder() const { // Call C routine to get the byte ordering H5T_order_t type_order = H5Tget_order( id ); @@ -92,6 +91,32 @@ H5T_order_t AtomType::getOrder( string& order_string ) const throw DataTypeIException("AtomType::getOrder", "H5Tget_order returns H5T_ORDER_ERROR"); } + return( type_order ); +} + +//-------------------------------------------------------------------------- +// Function: AtomType::getOrder +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c std::string for the buffer that +/// provide the text description of the returned byte order. +/// The text description can be either of the following: +/// "Little endian byte ordering (0)"; +/// "Big endian byte ordering (1)"; +/// "VAX mixed byte ordering (2)"; +///\param order_string - OUT: Text description of the returned byte order +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +H5T_order_t AtomType::getOrder( string& order_string ) const +{ + // Call the overloaded to get the type order without text + H5T_order_t type_order = getOrder(); + + // Then provide the text and return the type order if( type_order == H5T_ORDER_LE ) order_string = "Little endian byte ordering (0)"; else if( type_order == H5T_ORDER_BE ) |