diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2006-03-30 18:06:58 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2006-03-30 18:06:58 (GMT) |
commit | a7e993d72be8fed2f0d63a8169e185bb2a298842 (patch) | |
tree | 420d7ea5ab1fd6415710f5f623f9667721f3f78e /c++ | |
parent | 5a90c6b31c8904a407bb91ee4cc6a7aeecf73bed (diff) | |
download | hdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.zip hdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.tar.gz hdf5-a7e993d72be8fed2f0d63a8169e185bb2a298842.tar.bz2 |
[svn-r12180] Purpose: Maintenance
Description:
Added alias H5_std so either the global or std namespace can be
used, depending on H5_NO_STD.
Platforms tested:
Linux 2.4 (heping)
SunOS 5.8 64-bit (sol)
AIX 5.1 (copper)
Diffstat (limited to 'c++')
64 files changed, 287 insertions, 372 deletions
diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 99f386b..2955820 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -26,7 +26,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -35,7 +34,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "SDSextendible.h5" ); diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 37df231..994a036 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -27,7 +27,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -36,7 +35,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "SDScompound.h5" ); diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 85afc89..03cbb51 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -23,16 +23,11 @@ #endif #include <string> -#ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD -#endif - #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "SDS.h5" ); diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 5ec6448..81fb515 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -28,7 +28,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -37,7 +36,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "SDSextendible.h5" ); diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 437ba17..cd0eeb0 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -30,7 +30,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -39,7 +38,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "Group.h5" ); diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 8f00e33..7e10a55 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -27,7 +27,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -36,7 +35,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "SDS.h5" ); diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 388939d..24e4768 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -30,7 +30,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cout; using std::endl; #endif // H5_NO_STD @@ -39,7 +38,8 @@ #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif const string FILE_NAME( "Select.h5" ); diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index f71ccea..055d669 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 119c7bd..a19048f 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 896acc8..7106c7f 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -35,7 +35,7 @@ class H5_DLLCPP ArrayType : public DataType { int getArrayDims(hsize_t* dims); // Returns this class name - virtual string fromClass () const { return("ArrayType"); } + virtual H5_std::string fromClass () const { return("ArrayType"); } // Copy constructor: makes copy of the original object. ArrayType( const ArrayType& original ); diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 48d833c..2f98897 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -116,7 +113,7 @@ H5T_order_t AtomType::getOrder() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_order_t AtomType::getOrder( string& order_string ) const +H5T_order_t AtomType::getOrder( H5_std::string& order_string ) const { // Call the overloaded to get the type order without text H5T_order_t type_order = getOrder(); diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 4a09c05..9a1242b 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -27,7 +27,7 @@ namespace H5 { class H5_DLLCPP AtomType : public DataType { public: // Returns the byte order of an atomic datatype. - H5T_order_t getOrder( string& order_string ) const; + H5T_order_t getOrder( H5_std::string& order_string ) const; H5T_order_t getOrder() const; // Sets the byte ordering of an atomic datatype. @@ -56,7 +56,7 @@ class H5_DLLCPP AtomType : public DataType { void setSize( size_t size ) const; // Returns this class name - virtual string fromClass () const { return("AtomType"); } + virtual H5_std::string fromClass () const { return("AtomType"); } // Copy constructor - makes copy of the original object AtomType( const AtomType& original ); diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 89d72a8..48d1f10 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -96,7 +93,7 @@ void Attribute::write( const DataType& mem_type, const void *buf ) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - Apr, 2003 //-------------------------------------------------------------------------- -void Attribute::write( const DataType& mem_type, const string& strg ) const +void Attribute::write( const DataType& mem_type, const H5_std::string& strg ) const { // Convert string to C-string const char* strg_C; @@ -135,7 +132,7 @@ void Attribute::read( const DataType& mem_type, void *buf ) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - Apr, 2003 //-------------------------------------------------------------------------- -void Attribute::read( const DataType& mem_type, string& strg ) const +void Attribute::read( const DataType& mem_type, H5_std::string& strg ) const { size_t size = mem_type.getSize(); char* strg_C = new char[size+1]; // temporary C-string for C API @@ -201,7 +198,7 @@ hid_t Attribute::p_get_type() const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - Nov, 2001 //-------------------------------------------------------------------------- -ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const +ssize_t Attribute::getName( size_t buf_size, H5_std::string& attr_name ) const { char* name_C = new char[buf_size+1]; // temporary C-string for C API @@ -229,9 +226,9 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Attribute::getName( size_t buf_size ) const +H5_std::string Attribute::getName( size_t buf_size ) const { - string attr_name; + H5_std::string attr_name; ssize_t name_size = getName( buf_size, attr_name ); return( attr_name ); // let caller catch exception if any @@ -246,7 +243,7 @@ string Attribute::getName( size_t buf_size ) const ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -string Attribute::getName() const +H5_std::string Attribute::getName() const { // Try with 256 characters for the name first, if the name's length // returned is more than that then, read the name again with the @@ -254,7 +251,7 @@ string Attribute::getName() const char* name_C = new char[256]; // temporary C-string for C API ssize_t name_size = H5Aget_name(id, 255, name_C); - string attr_name; + H5_std::string attr_name; if (name_size >= 256) name_size = getName(name_size, attr_name); diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 21881c4..66f57a2 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -26,9 +26,9 @@ class H5_DLLCPP Attribute : public AbstractDs { virtual void close(); // Gets the name of this attribute. - ssize_t getName( size_t buf_size, string& attr_name ) const; - string getName( size_t buf_size ) const; // returns name, not its length - string getName() const; // returns name, no argument + ssize_t getName( size_t buf_size, H5_std::string& attr_name ) const; + H5_std::string getName( size_t buf_size ) const; // returns name, not its length + H5_std::string getName() const; // returns name, no argument // Gets a copy of the dataspace for this attribute. virtual DataSpace getSpace() const; @@ -38,14 +38,14 @@ class H5_DLLCPP Attribute : public AbstractDs { // Reads data from this attribute. void read( const DataType& mem_type, void *buf ) const; - void read( const DataType& mem_type, string& strg ) const; + void read( const DataType& mem_type, H5_std::string& strg ) const; // Writes data to this attribute. void write(const DataType& mem_type, const void *buf ) const; - void write(const DataType& mem_type, const string& strg ) const; + void write(const DataType& mem_type, const H5_std::string& strg ) const; // Returns this class name - virtual string fromClass () const { return("Attribute"); } + virtual H5_std::string fromClass () const { return("Attribute"); } // Creates a copy of an existing attribute using the attribute id Attribute( const hid_t attr_id ); diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index fb801e9..f7a89ba 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -93,7 +90,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group CommonFG::createGroup( const string& name, size_t size_hint ) const +Group CommonFG::createGroup( const H5_std::string& name, size_t size_hint ) const { return( createGroup( name.c_str(), size_hint )); } @@ -131,7 +128,7 @@ Group CommonFG::openGroup( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group CommonFG::openGroup( const string& name ) const +Group CommonFG::openGroup( const H5_std::string& name ) const { return( openGroup( name.c_str() )); } @@ -175,7 +172,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::createDataSet( const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const +DataSet CommonFG::createDataSet( const H5_std::string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const { return( createDataSet( name.c_str(), data_type, data_space, create_plist )); } @@ -212,7 +209,7 @@ DataSet CommonFG::openDataSet( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet CommonFG::openDataSet( const string& name ) const +DataSet CommonFG::openDataSet( const H5_std::string& name ) const { return( openDataSet( name.c_str() )); } @@ -249,7 +246,7 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne /// \c std::string for \a curr_name and \a new_name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::link( H5G_link_t link_type, const string& curr_name, const string& new_name ) const +void CommonFG::link( H5G_link_t link_type, const H5_std::string& curr_name, const H5_std::string& new_name ) const { link( link_type, curr_name.c_str(), new_name.c_str() ); } @@ -277,7 +274,7 @@ void CommonFG::unlink( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::unlink( const string& name ) const +void CommonFG::unlink( const H5_std::string& name ) const { unlink( name.c_str() ); } @@ -311,7 +308,7 @@ void CommonFG::move( const char* src, const char* dst ) const /// \c std::string for \a src and \a dst. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::move( const string& src, const string& dst ) const +void CommonFG::move( const H5_std::string& src, const H5_std::string& dst ) const { move( src.c_str(), dst.c_str() ); } @@ -345,7 +342,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo( const H5_std::string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const { getObjinfo( name.c_str(), follow_link, statbuf ); } @@ -373,7 +370,7 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- -void CommonFG::getObjinfo( const string& name, H5G_stat_t& statbuf ) const +void CommonFG::getObjinfo( const H5_std::string& name, H5G_stat_t& statbuf ) const { getObjinfo( name.c_str(), statbuf ); } @@ -387,7 +384,7 @@ void CommonFG::getObjinfo( const string& name, H5G_stat_t& statbuf ) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string CommonFG::getLinkval( const char* name, size_t size ) const +H5_std::string CommonFG::getLinkval( const char* name, size_t size ) const { char* value_C = new char[size+1]; // temporary C-string for C API @@ -396,7 +393,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const { throwException("getLinkval", "H5Gget_linkval failed"); } - string value = string( value_C ); + H5_std::string value = H5_std::string( value_C ); delete []value_C; return( value ); } @@ -408,7 +405,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string CommonFG::getLinkval( const string& name, size_t size ) const +H5_std::string CommonFG::getLinkval( const H5_std::string& name, size_t size ) const { return( getLinkval( name.c_str(), size )); } @@ -444,7 +441,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const /// \c std::string for \a name and \a comment. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::setComment( const string& name, const string& comment ) const +void CommonFG::setComment( const H5_std::string& name, const H5_std::string& comment ) const { setComment( name.c_str(), comment.c_str() ); } @@ -472,7 +469,7 @@ void CommonFG::removeComment(const char* name) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- -void CommonFG::removeComment(const string& name) const +void CommonFG::removeComment(const H5_std::string& name) const { removeComment (name.c_str()); } @@ -485,7 +482,7 @@ void CommonFG::removeComment(const string& name) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- -string CommonFG::getComment (const string& name) const +H5_std::string CommonFG::getComment (const H5_std::string& name) const { size_t bufsize = 256; // anticipating the comment's length hid_t loc_id = getLocId(); // temporary variable @@ -510,7 +507,7 @@ string CommonFG::getComment (const string& name) const { throwException("getComment", "H5Gget_comment failed"); } - string comment = string( comment_C ); + H5_std::string comment = H5_std::string( comment_C ); delete []comment_C; return (comment); } @@ -525,7 +522,7 @@ string CommonFG::getComment (const string& name) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string CommonFG::getComment( const char* name, size_t bufsize ) const +H5_std::string CommonFG::getComment( const char* name, size_t bufsize ) const { // temporary C-string for the object's comment char* comment_C = new char[bufsize+1]; @@ -537,7 +534,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const { throwException("getComment", "H5Gget_comment failed"); } - string comment = string( comment_C ); + H5_std::string comment = H5_std::string( comment_C ); delete []comment_C; return( comment ); } @@ -549,7 +546,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string CommonFG::getComment( const string& name, size_t bufsize ) const +H5_std::string CommonFG::getComment( const H5_std::string& name, size_t bufsize ) const { return( getComment( name.c_str(), bufsize )); } @@ -586,7 +583,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::mount( const string& name, H5File& child, PropList& plist ) const +void CommonFG::mount( const H5_std::string& name, H5File& child, PropList& plist ) const { mount( name.c_str(), child, plist ); } @@ -617,7 +614,7 @@ void CommonFG::unmount( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CommonFG::unmount( const string& name ) const +void CommonFG::unmount( const H5_std::string& name ) const { unmount( name.c_str() ); } @@ -653,7 +650,7 @@ DataType CommonFG::openDataType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType( const string& name ) const +DataType CommonFG::openDataType( const H5_std::string& name ) const { return( openDataType( name.c_str()) ); } @@ -689,7 +686,7 @@ ArrayType CommonFG::openArrayType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType( const string& name ) const +ArrayType CommonFG::openArrayType( const H5_std::string& name ) const { return( openArrayType( name.c_str()) ); } @@ -725,7 +722,7 @@ CompType CommonFG::openCompType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType( const string& name ) const +CompType CommonFG::openCompType( const H5_std::string& name ) const { return( openCompType( name.c_str()) ); } @@ -761,7 +758,7 @@ EnumType CommonFG::openEnumType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType( const string& name ) const +EnumType CommonFG::openEnumType( const H5_std::string& name ) const { return( openEnumType( name.c_str()) ); } @@ -797,7 +794,7 @@ IntType CommonFG::openIntType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType( const string& name ) const +IntType CommonFG::openIntType( const H5_std::string& name ) const { return( openIntType( name.c_str()) ); } @@ -833,7 +830,7 @@ FloatType CommonFG::openFloatType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType( const string& name ) const +FloatType CommonFG::openFloatType( const H5_std::string& name ) const { return( openFloatType( name.c_str()) ); } @@ -869,7 +866,7 @@ StrType CommonFG::openStrType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType( const string& name ) const +StrType CommonFG::openStrType( const H5_std::string& name ) const { return( openStrType( name.c_str()) ); } @@ -905,7 +902,7 @@ VarLenType CommonFG::openVarLenType( const char* name ) const /// \c std::string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType( const string& name ) const +VarLenType CommonFG::openVarLenType( const H5_std::string& name ) const { return( openVarLenType( name.c_str()) ); } @@ -940,7 +937,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int CommonFG::iterateElems( const string& name, int *idx, H5G_iterate_t op , void* op_data ) +int CommonFG::iterateElems( const H5_std::string& name, int *idx, H5G_iterate_t op , void* op_data ) { return( iterateElems( name.c_str(), idx, op, op_data )); } @@ -978,7 +975,7 @@ hsize_t CommonFG::getNumObjs() const /// each time the group is opened. // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- -string CommonFG::getObjnameByIdx(hsize_t idx) const +H5_std::string CommonFG::getObjnameByIdx(hsize_t idx) const { // call H5Gget_objname_by_idx with name as NULL to get its length ssize_t name_len = H5Gget_objname_by_idx(getLocId(), idx, NULL, 0); @@ -992,7 +989,7 @@ string CommonFG::getObjnameByIdx(hsize_t idx) const name_len = H5Gget_objname_by_idx(getLocId(), idx, name_C, name_len); // clean up and return the string - string name = string(name_C); + H5_std::string name = H5_std::string(name_C); delete []name_C; return (name); } @@ -1014,7 +1011,7 @@ string CommonFG::getObjnameByIdx(hsize_t idx) const /// each time the group is opened. // Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- -ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const +ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5_std::string& name, size_t size) const { char* name_C = new char[size]; ssize_t name_len = H5Gget_objname_by_idx(getLocId(), idx, name_C, size); @@ -1022,7 +1019,7 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const { throwException("getObjnameByIdx", "H5Gget_objname_by_idx failed"); } - name = string( name_C ); + name = H5_std::string( name_C ); delete [] name_C; return (name_len); } @@ -1057,15 +1054,15 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- -H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, string& type_name) const +H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5_std::string& type_name) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx); switch (obj_type) { - case H5G_LINK: type_name = string("symbolic link"); break; - case H5G_GROUP: type_name = string("group"); break; - case H5G_DATASET: type_name = string("dataset"); break; - case H5G_TYPE: type_name = string("datatype"); break; + case H5G_LINK: type_name = H5_std::string("symbolic link"); break; + case H5G_GROUP: type_name = H5_std::string("group"); break; + case H5G_DATASET: type_name = H5_std::string("dataset"); break; + case H5G_TYPE: type_name = H5_std::string("datatype"); break; case H5G_UNKNOWN: default: { diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 8fa1e1d..05ddc7c 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -33,37 +33,37 @@ class H5_DLLCPP CommonFG { // Creates a new group at this location which can be a file // or another group. Group createGroup(const char* name, size_t size_hint = 0) const; - Group createGroup(const string& name, size_t size_hint = 0) const; + Group createGroup(const H5_std::string& name, size_t size_hint = 0) const; // Opens an existing group in a location which can be a file // or another group. Group openGroup(const char* name) const; - Group openGroup(const string& name) const; + Group openGroup(const H5_std::string& name) const; // Creates a new dataset at this location. DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - DataSet createDataSet(const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + DataSet createDataSet(const H5_std::string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; // Opens an existing dataset at this location. DataSet openDataSet(const char* name) const; - DataSet openDataSet(const string& name) const; + DataSet openDataSet(const H5_std::string& name) const; // Retrieves comment for the HDF5 object specified by its name. - string getComment(const string& name) const; - string getComment(const char* name, size_t bufsize) const; - string getComment(const string& name, size_t bufsize) const; + H5_std::string getComment(const H5_std::string& name) const; + H5_std::string getComment(const char* name, size_t bufsize) const; + H5_std::string getComment(const H5_std::string& name, size_t bufsize) const; // Removes the comment for the HDF5 object specified by its name. void removeComment(const char* name) const; - void removeComment(const string& name) const; + void removeComment(const H5_std::string& name) const; // Sets the comment for an HDF5 object specified by its name. void setComment(const char* name, const char* comment) const; - void setComment(const string& name, const string& comment) const; + void setComment(const H5_std::string& name, const H5_std::string& comment) const; // Returns the name of the HDF5 object that the symbolic link points to. - string getLinkval(const char* name, size_t size) const; - string getLinkval(const string& name, size_t size) const; + H5_std::string getLinkval(const char* name, size_t size) const; + H5_std::string getLinkval(const H5_std::string& name, size_t size) const; // Returns the number of objects in this group. hsize_t getNumObjs() const; @@ -71,77 +71,77 @@ class H5_DLLCPP CommonFG { // Returns information about an HDF5 object, given by its name, // at this location. void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const H5_std::string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; void getObjinfo(const char* name, H5G_stat_t& statbuf) const; - void getObjinfo(const string& name, H5G_stat_t& statbuf) const; + void getObjinfo(const H5_std::string& name, H5G_stat_t& statbuf) const; // Retrieves the name of an object in this group, given the // object's index. - ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const; - string getObjnameByIdx(hsize_t idx) const; + ssize_t getObjnameByIdx(hsize_t idx, H5_std::string& name, size_t size) const; + H5_std::string getObjnameByIdx(hsize_t idx) const; // Returns the type of an object in this group, given the // object's index. H5G_obj_t getObjTypeByIdx(hsize_t idx) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, H5_std::string& type_name) const; // Iterates over the elements of this group - not implemented in // C++ style yet. int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); - int iterateElems(const string& name, int *idx, H5G_iterate_t op, void *op_data); + int iterateElems(const H5_std::string& name, int *idx, H5G_iterate_t op, void *op_data); // Creates a link of the specified type from new_name to current_name; // both names are interpreted relative to the specified location id. void link(H5G_link_t link_type, const char* curr_name, const char* new_name) const; - void link(H5G_link_t link_type, const string& curr_name, const string& new_name) const; + void link(H5G_link_t link_type, const H5_std::string& curr_name, const H5_std::string& new_name) const; // Removes the specified name at this location. void unlink(const char* name) const; - void unlink(const string& name) const; + void unlink(const H5_std::string& name) const; // Mounts the file 'child' onto this location. void mount(const char* name, H5File& child, PropList& plist) const; - void mount(const string& name, H5File& child, PropList& plist) const; + void mount(const H5_std::string& name, H5File& child, PropList& plist) const; // Unmounts the file named 'name' from this parent location. void unmount(const char* name) const; - void unmount(const string& name) const; + void unmount(const H5_std::string& name) const; // Renames an object at this location. void move(const char* src, const char* dst) const; - void move(const string& src, const string& dst) const; + void move(const H5_std::string& src, const H5_std::string& dst) const; // Opens a generic named datatype in this location. DataType openDataType(const char* name) const; - DataType openDataType(const string& name) const; + DataType openDataType(const H5_std::string& name) const; // Opens a named array datatype in this location. ArrayType openArrayType(const char* name) const; - ArrayType openArrayType(const string& name) const; + ArrayType openArrayType(const H5_std::string& name) const; // Opens a named compound datatype in this location. CompType openCompType(const char* name) const; - CompType openCompType(const string& name) const; + CompType openCompType(const H5_std::string& name) const; // Opens a named enumeration datatype in this location. EnumType openEnumType(const char* name) const; - EnumType openEnumType(const string& name) const; + EnumType openEnumType(const H5_std::string& name) const; // Opens a named integer datatype in this location. IntType openIntType(const char* name) const; - IntType openIntType(const string& name) const; + IntType openIntType(const H5_std::string& name) const; // Opens a named floating-point datatype in this location. FloatType openFloatType(const char* name) const; - FloatType openFloatType(const string& name) const; + FloatType openFloatType(const H5_std::string& name) const; // Opens a named string datatype in this location. StrType openStrType(const char* name) const; - StrType openStrType(const string& name) const; + StrType openStrType(const H5_std::string& name) const; // Opens a named variable length datatype in this location. VarLenType openVarLenType(const char* name) const; - VarLenType openVarLenType(const string& name) const; + VarLenType openVarLenType(const H5_std::string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS /// For subclasses, H5File and Group, to return the correct @@ -151,7 +151,7 @@ class H5_DLLCPP CommonFG { #endif // DOXYGEN_SHOULD_SKIP_THIS /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const string func_name, const string msg) const = 0; + virtual void throwException(const H5_std::string func_name, const H5_std::string msg) const = 0; // Default constructor. CommonFG(); diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index e74b972..21a32f5 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -118,7 +115,7 @@ int CompType::getNmembers() const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string CompType::getMemberName( unsigned member_num ) const +H5_std::string CompType::getMemberName( unsigned member_num ) const { char* member_name_C = H5Tget_member_name( id, member_num ); if( member_name_C == NULL ) // NULL means failure @@ -126,7 +123,7 @@ string CompType::getMemberName( unsigned member_num ) const throw DataTypeIException("CompType::getMemberName", "H5Tget_member_name returns NULL for member name"); } - string member_name = string(member_name_C); // convert C string to string + H5_std::string member_name = H5_std::string(member_name_C); // convert C string to string HDfree(member_name_C); // free the C string return( member_name ); // return the member name string } @@ -153,7 +150,7 @@ int CompType::getMemberIndex(const char* name) const } return( member_index ); } -int CompType::getMemberIndex(const string& name) const +int CompType::getMemberIndex(const H5_std::string& name) const { return(getMemberIndex(name.c_str())); } @@ -421,7 +418,7 @@ void CompType::getMemberType( unsigned member_num, StrType& strtype ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CompType::insertMember( const string& name, size_t offset, const DataType& new_member ) const +void CompType::insertMember( const H5_std::string& name, size_t offset, const DataType& new_member ) const { // Convert string to C-string const char* name_C; diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 8176693..58e3286 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -38,13 +38,13 @@ class H5_DLLCPP CompType : public DataType { // Returns the index of a member in this compound data type. int getMemberIndex(const char* name) const; - int getMemberIndex(const string& name) const; + int getMemberIndex(const H5_std::string& name) const; // Returns the offset of a member of this compound datatype. size_t getMemberOffset( unsigned memb_no ) const; // Returns the name of a member of this compound datatype. - string getMemberName( unsigned member_num ) const; + H5_std::string getMemberName( unsigned member_num ) const; // Returns the generic datatype of the specified member in // this compound datatype. @@ -82,13 +82,13 @@ class H5_DLLCPP CompType : public DataType { int getNmembers() const; // Adds a new member to this compound datatype. - void insertMember( const string& name, size_t offset, const DataType& new_member ) const; + void insertMember( const H5_std::string& name, size_t offset, const DataType& new_member ) const; // Recursively removes padding from within this compound datatype. void pack() const; // Returns this class name - virtual string fromClass () const { return("CompType"); } + virtual H5_std::string fromClass () const { return("CompType"); } // Default constructor CompType(); diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 027be88..46bfdec 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -259,7 +256,7 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp /// It takes a reference to a \c std::string for the buffer. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::read( H5_std::string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { // Allocate C character string for reading size_t size = mem_type.getSize(); @@ -310,7 +307,7 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& /// It takes a reference to a \c std::string for the buffer. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::write( const string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::write( const H5_std::string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { // Convert string to C-string const char* strg_C; @@ -469,7 +466,7 @@ void* DataSet::Reference(const char* name) const ///\param name - IN: Name of the object to be referenced - \c std::string // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void* DataSet::Reference(const string& name) const +void* DataSet::Reference(const H5_std::string& name) const { return(Reference(name.c_str())); } diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index e3a4987..a152d27 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -58,13 +58,13 @@ class H5_DLLCPP DataSet : public AbstractDs { // The memory and file dataspaces and the transferring property list // can be defaults. void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void read( string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void read( H5_std::string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; // Writes the buffered data to this dataset. // The memory and file dataspaces and the transferring property list // can be defaults. void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void write( const string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void write( const H5_std::string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL ); @@ -81,10 +81,10 @@ class H5_DLLCPP DataSet : public AbstractDs { // Creates a reference to a named Hdf5 object in this object. void* Reference(const char* name) const; - void* Reference(const string& name) const; + void* Reference(const H5_std::string& name) const; // Returns this class name - virtual string fromClass () const { return("DataSet"); } + virtual H5_std::string fromClass () const { return("DataSet"); } // Creates a copy of an existing DataSet using its id. DataSet(const hid_t existing_id); diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 5fdab7c..0befc6e 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 35a7891..e4b3e96 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -103,7 +103,7 @@ class H5_DLLCPP DataSpace : public IdComponent { void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; // Returns this class name - virtual string fromClass () const { return("DataSpace"); } + virtual H5_std::string fromClass () const { return("DataSpace"); } // Creates a DataSpace object using an existing dataspace id. DataSpace(const hid_t space_id); diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index b248d7f..6d3694e 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -192,7 +189,7 @@ void DataType::commit(CommonFG& loc, const char* name) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::commit(CommonFG& loc, const string& name) const +void DataType::commit(CommonFG& loc, const H5_std::string& name) const { commit( loc, name.c_str() ); } @@ -391,7 +388,7 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::registerFunc( H5T_pers_t pers, const H5_std::string& name, const DataType& dest, H5T_conv_t func ) const { registerFunc( pers, name.c_str(), dest, func ); } @@ -428,7 +425,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::unregister( H5T_pers_t pers, const H5_std::string& name, const DataType& dest, H5T_conv_t func ) const { unregister( pers, name.c_str(), dest, func ); } @@ -458,7 +455,7 @@ void DataType::setTag( const char* tag ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag( const string& tag ) const +void DataType::setTag( const H5_std::string& tag ) const { setTag( tag.c_str()); } @@ -470,7 +467,7 @@ void DataType::setTag( const string& tag ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string DataType::getTag() const +H5_std::string DataType::getTag() const { char* tag_Cstr = H5Tget_tag( id ); @@ -478,7 +475,7 @@ string DataType::getTag() const // and return it, otherwise, raise an exception if( tag_Cstr != NULL ) { - string tag = string(tag_Cstr); // convert C string to string object + H5_std::string tag = H5_std::string(tag_Cstr); // convert C string to string object HDfree(tag_Cstr); // free the C string return (tag); // return the tag } @@ -585,7 +582,7 @@ void* DataType::Reference(const char* name) const ///\param name - IN: Name of the object to be referenced - \c std::string // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void* DataType::Reference(const string& name) const +void* DataType::Reference(const H5_std::string& name) const { return(Reference(name.c_str())); } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 10a6906..d3780bc 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -40,7 +40,7 @@ class H5_DLLCPP DataType : public H5Object { // Commits a transient datatype to a file; this datatype becomes // a named datatype which can be accessed from the location. void commit( CommonFG& loc, const char* name ) const; - void commit( CommonFG& loc, const string& name ) const; + void commit( CommonFG& loc, const H5_std::string& name ) const; // Determines whether this datatype is a named datatype or // a transient datatype. @@ -71,18 +71,18 @@ class H5_DLLCPP DataType : public H5Object { // Registers a conversion function. void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; + void registerFunc(H5T_pers_t pers, const H5_std::string& name, const DataType& dest, H5T_conv_t func ) const; // Removes a conversion function from all conversion paths. void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; + void unregister( H5T_pers_t pers, const H5_std::string& name, const DataType& dest, H5T_conv_t func ) const; // Tags an opaque datatype. void setTag( const char* tag ) const; - void setTag( const string& tag ) const; + void setTag( const H5_std::string& tag ) const; // Gets the tag associated with an opaque datatype. - string getTag() const; + H5_std::string getTag() const; // Checks whether this datatype contains (or is) a certain type class. bool detectClass(H5T_class_t cls) const; @@ -92,7 +92,7 @@ class H5_DLLCPP DataType : public H5Object { // Creates a reference to a named Hdf5 object in this object. void* Reference(const char* name) const; - void* Reference(const string& name) const; + void* Reference(const H5_std::string& name) const; // Creates a reference to a named Hdf5 object or to a dataset region // in this object. @@ -104,7 +104,7 @@ class H5_DLLCPP DataType : public H5Object { // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; - virtual string fromClass () const { return("DataType"); } + virtual H5_std::string fromClass () const { return("DataType"); } // Creates a copy of an existing DataType using its id DataType( const hid_t type_id ); diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index bf1a616..d63ec9e 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 0d8b1ae..99cf354 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -101,7 +101,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList { void setShuffle(); // Returns this class name - virtual string fromClass () const { return("DSetCreatPropList"); } + virtual H5_std::string fromClass () const { return("DSetCreatPropList"); } // Default constructor: creates a stub dataset creation property list. DSetCreatPropList(); diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 081e610..b6da395 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 59aeb7b..4f992bd 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -95,7 +95,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { H5Z_EDC_t getEDCCheck(); // Returns this class name - virtual string fromClass () const { return("DSetMemXferPropList"); } + virtual H5_std::string fromClass () const { return("DSetMemXferPropList"); } // Creates a copy of an existing dataset memory and transfer // property list using the property list id. diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 621f65c..462c767 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -137,7 +134,7 @@ void EnumType::insert( const char* name, void *value ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert( const string& name, void *value ) const +void EnumType::insert( const H5_std::string& name, void *value ) const { insert( name.c_str(), value ); } @@ -151,7 +148,7 @@ void EnumType::insert( const string& name, void *value ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string EnumType::nameOf( void *value, size_t size ) const +H5_std::string EnumType::nameOf( void *value, size_t size ) const { char* name_C = new char[size+1]; // temporary C-string for C API @@ -164,7 +161,7 @@ string EnumType::nameOf( void *value, size_t size ) const throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); } // otherwise, create the string to hold the datatype name and return it - string name = string( name_C ); + H5_std::string name = H5_std::string( name_C ); delete [] name_C; return( name ); } @@ -195,7 +192,7 @@ void EnumType::valueOf( const char* name, void *value ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf( const string& name, void *value ) const +void EnumType::valueOf( const H5_std::string& name, void *value ) const { valueOf( name.c_str(), value ); } @@ -228,7 +225,7 @@ int EnumType::getMemberIndex(const char *name) const /// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- -int EnumType::getMemberIndex(const string& name) const +int EnumType::getMemberIndex(const H5_std::string& name) const { return(EnumType::getMemberIndex(name.c_str())); } diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 9b38fa4..8c855cd 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -38,26 +38,26 @@ class H5_DLLCPP EnumType : public DataType { // Returns the index of a member in this enumeration data type. int getMemberIndex(const char* name) const; - int getMemberIndex(const string& name) const; + int getMemberIndex(const H5_std::string& name) const; // Returns the value of an enumeration datatype member void getMemberValue( unsigned memb_no, void *value ) const; // Inserts a new member to this enumeration type. void insert( const char* name, void *value ) const; - void insert( const string& name, void *value ) const; + void insert( const H5_std::string& name, void *value ) const; // Returns the symbol name corresponding to a specified member // of this enumeration datatype. - string nameOf( void *value, size_t size ) const; + H5_std::string nameOf( void *value, size_t size ) const; // Returns the value corresponding to a specified member of this // enumeration datatype. void valueOf( const char* name, void *value ) const; - void valueOf( const string& name, void *value ) const; + void valueOf( const H5_std::string& name, void *value ) const; // Returns this class name - virtual string fromClass () const { return("EnumType"); } + virtual H5_std::string fromClass () const { return("EnumType"); } // Default constructor EnumType(); diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 4af1ffc..d7dd475 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -26,7 +23,7 @@ namespace H5 { #endif -const string Exception::DEFAULT_MSG("No detailed information provided"); +const H5_std::string Exception::DEFAULT_MSG("No detailed information provided"); //-------------------------------------------------------------------------- // Function: Exception default constructor @@ -43,7 +40,7 @@ Exception::Exception() : detail_message(""), func_name("") {} ///\param message - IN: Message on the failure // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception(const string func_name, const string message) : detail_message(message), func_name(func_name) {} +Exception::Exception(const H5_std::string func_name, const H5_std::string message) : detail_message(message), func_name(func_name) {} //-------------------------------------------------------------------------- // Function: Exception copy constructor @@ -68,7 +65,7 @@ Exception::Exception( const Exception& orig ) /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getMajorString( hid_t err_major ) const +H5_std::string Exception::getMajorString( hid_t err_major ) const { // Preliminary call to H5Eget_msg() to get the length of the message ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); @@ -88,7 +85,7 @@ string Exception::getMajorString( hid_t err_major ) const "H5Eget_msg failed"); // Convert the C error description and return - string major_str(mesg_C); + H5_std::string major_str(mesg_C); delete []mesg_C; return( major_str ); } @@ -104,7 +101,7 @@ string Exception::getMajorString( hid_t err_major ) const /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getMinorString( hid_t err_minor ) const +H5_std::string Exception::getMinorString( hid_t err_minor ) const { // Preliminary call to H5Eget_msg() to get the length of the message ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); @@ -124,7 +121,7 @@ string Exception::getMinorString( hid_t err_minor ) const "H5Eget_msg failed"); // Convert the C error description and return - string minor_str(mesg_C); + H5_std::string minor_str(mesg_C); delete []mesg_C; return( minor_str ); } @@ -259,7 +256,7 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void ///\return Text message - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getDetailMsg() const +H5_std::string Exception::getDetailMsg() const { return(detail_message); } @@ -282,7 +279,7 @@ const char* Exception::getCDetailMsg() const ///\return Text message - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getFuncName() const +H5_std::string Exception::getFuncName() const { return(func_name); } @@ -334,7 +331,7 @@ FileIException::FileIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -FileIException::FileIException(const string func_name, const string message) : Exception(func_name, message) {} +FileIException::FileIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: FileIException destructor ///\brief Noop destructor. @@ -357,7 +354,7 @@ GroupIException::GroupIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -GroupIException::GroupIException(const string func_name, const string message) : Exception(func_name, message) {} +GroupIException::GroupIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: GroupIException destructor ///\brief Noop destructor. @@ -380,7 +377,7 @@ DataSpaceIException::DataSpaceIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -DataSpaceIException::DataSpaceIException(const string func_name, const string message) : Exception(func_name, message) {} +DataSpaceIException::DataSpaceIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: DataSpaceIException destructor ///\brief Noop destructor. @@ -403,7 +400,7 @@ DataTypeIException::DataTypeIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -DataTypeIException::DataTypeIException(const string func_name, const string message) : Exception(func_name, message) {} +DataTypeIException::DataTypeIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: DataTypeIException destructor ///\brief Noop destructor. @@ -426,7 +423,7 @@ PropListIException::PropListIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -PropListIException::PropListIException(const string func_name, const string message) : Exception(func_name, message) {} +PropListIException::PropListIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: PropListIException destructor ///\brief Noop destructor. @@ -449,7 +446,7 @@ DataSetIException::DataSetIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -DataSetIException::DataSetIException(const string func_name, const string message) : Exception(func_name, message) {} +DataSetIException::DataSetIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: DataSetIException destructor ///\brief Noop destructor. @@ -472,7 +469,7 @@ AttributeIException::AttributeIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -AttributeIException::AttributeIException(const string func_name, const string message) : Exception(func_name, message) {} +AttributeIException::AttributeIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: AttributeIException destructor ///\brief Noop destructor. @@ -495,7 +492,7 @@ ReferenceException::ReferenceException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -ReferenceException::ReferenceException(const string func_name, const string message) : Exception(func_name, message) {} +ReferenceException::ReferenceException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: ReferenceException destructor ///\brief Noop destructor. @@ -518,7 +515,7 @@ LibraryIException::LibraryIException():Exception(){} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -LibraryIException::LibraryIException(const string func_name, const string message) : Exception(func_name, message) {} +LibraryIException::LibraryIException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: LibraryIException destructor ///\brief Noop destructor. @@ -541,7 +538,7 @@ IdComponentException::IdComponentException(): Exception() {} ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- -IdComponentException::IdComponentException(const string func_name, const string message) : Exception(func_name, message) {} +IdComponentException::IdComponentException(const H5_std::string func_name, const H5_std::string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: IdComponentException destructor ///\brief Noop destructor. diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 591fcab..7d9817f 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -20,29 +20,31 @@ #ifndef H5_NO_NAMESPACE namespace H5 { -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD +#ifdef H5_NO_STD + namespace H5_std =; +#else + namespace H5_std = std; +#endif #endif class H5_DLLCPP Exception { public: // Creates an exception with a function name where the failure occurs // and an optional detailed message - Exception(const string func_name, const string message = DEFAULT_MSG); + Exception(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); // Returns a character string that describes the error specified by // a major error number. - string getMajorString( hid_t err_major_id ) const; + H5_std::string getMajorString( hid_t err_major_id ) const; // Returns a character string that describes the error specified by // a minor error number. - string getMinorString( hid_t err_minor_id ) const; + H5_std::string getMinorString( hid_t err_minor_id ) const; // Returns the detailed message set at the time the exception is thrown - string getDetailMsg() const; + H5_std::string getDetailMsg() const; const char* getCDetailMsg() const; // C string of detailed message - string getFuncName() const; // function name as a string object + H5_std::string getFuncName() const; // function name as a string object const char* getCFuncName() const; // function name as a char string // Turns on the automatic error printing. @@ -82,80 +84,80 @@ class H5_DLLCPP Exception { #if defined(WIN32) #pragma warning(disable: 4251) #endif - string detail_message; - string func_name; + H5_std::string detail_message; + H5_std::string func_name; protected: // Default value for detail_message - static const string DEFAULT_MSG; + static const H5_std::string DEFAULT_MSG; }; class H5_DLLCPP FileIException : public Exception { public: - FileIException( const string func_name, const string message = DEFAULT_MSG); + FileIException( const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); FileIException(); virtual ~FileIException(); }; class H5_DLLCPP GroupIException : public Exception { public: - GroupIException( const string func_name, const string message = DEFAULT_MSG); + GroupIException( const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); GroupIException(); virtual ~GroupIException(); }; class H5_DLLCPP DataSpaceIException : public Exception { public: - DataSpaceIException(const string func_name, const string message = DEFAULT_MSG); + DataSpaceIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); DataSpaceIException(); virtual ~DataSpaceIException(); }; class H5_DLLCPP DataTypeIException : public Exception { public: - DataTypeIException(const string func_name, const string message = DEFAULT_MSG); + DataTypeIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); DataTypeIException(); virtual ~DataTypeIException(); }; class H5_DLLCPP PropListIException : public Exception { public: - PropListIException(const string func_name, const string message = DEFAULT_MSG); + PropListIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); PropListIException(); virtual ~PropListIException(); }; class H5_DLLCPP DataSetIException : public Exception { public: - DataSetIException(const string func_name, const string message = DEFAULT_MSG); + DataSetIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); DataSetIException(); virtual ~DataSetIException(); }; class H5_DLLCPP AttributeIException : public Exception { public: - AttributeIException(const string func_name, const string message = DEFAULT_MSG); + AttributeIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); AttributeIException(); virtual ~AttributeIException(); }; class H5_DLLCPP ReferenceException : public Exception { public: - ReferenceException(const string func_name, const string message = DEFAULT_MSG); + ReferenceException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); ReferenceException(); virtual ~ReferenceException(); }; class H5_DLLCPP LibraryIException : public Exception { public: - LibraryIException(const string func_name, const string message = DEFAULT_MSG); + LibraryIException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); LibraryIException(); virtual ~LibraryIException(); }; class H5_DLLCPP IdComponentException : public Exception { public: - IdComponentException(const string func_name, const string message = DEFAULT_MSG); + IdComponentException(const H5_std::string func_name, const H5_std::string message = DEFAULT_MSG); IdComponentException(); virtual ~IdComponentException(); }; diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index f96fe97..62d5f72 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -291,7 +288,7 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const +void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const H5_std::string& meta_ext, const H5_std::string& raw_ext ) const { setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); } @@ -446,7 +443,7 @@ void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_siz ///\param buf_size - IN: Size of the logging buffer // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setLog(const string& logfile, unsigned flags, size_t buf_size) const +void FileAccPropList::setLog(const H5_std::string& logfile, unsigned flags, size_t buf_size) const { setLog(logfile.c_str(), flags, buf_size); } diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 38da7e3..993dcc6 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -61,7 +61,7 @@ class H5_DLLCPP FileAccPropList : public PropList { void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const; void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, - const string& meta_ext, const string& raw_ext ) const; + const H5_std::string& meta_ext, const H5_std::string& raw_ext ) const; #ifdef H5_HAVE_STREAM // for Stream Virtual File Driver // Modifies this file access property list to use the Stream driver. @@ -86,7 +86,7 @@ class H5_DLLCPP FileAccPropList : public PropList { // Modifies this file access property list to use the logging driver. void setLog(const char *logfile, unsigned flags, size_t buf_size) const; - void setLog(const string& logfile, unsigned flags, size_t buf_size) const; + void setLog(const H5_std::string& logfile, unsigned flags, size_t buf_size) const; // Sets alignment properties of this file access property list void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; @@ -120,7 +120,7 @@ class H5_DLLCPP FileAccPropList : public PropList { unsigned getGcReferences() const; // Returns this class name - virtual string fromClass () const { return("FileAccPropList"); } + virtual H5_std::string fromClass () const { return("FileAccPropList"); } // Creates a file access property list. FileAccPropList(); diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index cf76ffd..aaee59c 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 3624531..ae1f4d0 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -57,7 +57,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { void setIstorek( unsigned ik ) const; // Returns this class name - virtual string fromClass () const { return("FileCreatPropList"); } + virtual H5_std::string fromClass () const { return("FileCreatPropList"); } // Creates a file create property list. FileCreatPropList(); diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index b3f1c35..a7a690d 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -102,7 +99,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c /// FileCreatPropList::DEFAULT // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent() +H5File::H5File( const H5_std::string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent() { p_get_file(name.c_str(), flags, create_plist, access_plist); } @@ -196,7 +193,7 @@ bool H5File::isHdf5(const char* name) ///\param name - IN: Name of the file - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const string& name ) +bool H5File::isHdf5(const H5_std::string& name ) { return( isHdf5( name.c_str()) ); } @@ -239,7 +236,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis /// FileAccPropList::DEFAULT // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5File::openFile(const string& name, unsigned int flags, const FileAccPropList& access_plist) +void H5File::openFile(const H5_std::string& name, unsigned int flags, const FileAccPropList& access_plist) { openFile(name.c_str(), flags, access_plist); } @@ -497,7 +494,7 @@ void H5File::getVFDHandle(void **file_handle) const ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- -string H5File::getFileName() const +H5_std::string H5File::getFileName() const { try { return(p_get_file_name()); @@ -564,7 +561,7 @@ void* H5File::Reference(const char* name) const ///\param name - IN: Name of the object to be referenced - \c std::string // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void* H5File::Reference(const string& name) const +void* H5File::Reference(const H5_std::string& name) const { return(Reference(name.c_str())); } @@ -678,9 +675,9 @@ void H5File::close() // implementation of H5File. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5File::throwException(const string func_name, const string msg) const +void H5File::throwException(const H5_std::string func_name, const H5_std::string msg) const { - string full_name = func_name; + H5_std::string full_name = func_name; full_name.insert(0, "H5File::"); throw FileIException(full_name, msg); } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 84947fd..aa6af67 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -26,12 +26,12 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - H5File( const string& name, unsigned int flags, + H5File( const H5_std::string& name, unsigned int flags, const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); // Open the file - void openFile(const string& name, unsigned int flags, + void openFile(const H5_std::string& name, unsigned int flags, const FileAccPropList& access_plist = FileAccPropList::DEFAULT); void openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist = FileAccPropList::DEFAULT); @@ -49,7 +49,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { FileCreatPropList getCreatePlist() const; // Gets the name of this file. - string getFileName() const; + H5_std::string getFileName() const; // Retrieves the file size of an opened file. hsize_t getFileSize() const; @@ -78,7 +78,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Determines if a file, specified by its name, is in HDF5 format static bool isHdf5(const char* name ); - static bool isHdf5(const string& name ); + static bool isHdf5(const H5_std::string& name ); // Reopens this file. void reOpen(); // added for better name @@ -90,13 +90,13 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Creates a reference to a named Hdf5 object in this object. void* Reference(const char* name) const; - void* Reference(const string& name) const; + void* Reference(const H5_std::string& name) const; // Returns this class name - virtual string fromClass () const { return("H5File"); } + virtual H5_std::string fromClass () const { return("H5File"); } // Throw file exception. - virtual void throwException(const string func_name, const string msg) const; + virtual void throwException(const H5_std::string func_name, const H5_std::string msg) const; // Gets the file id virtual hid_t getLocId() const; diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index d56c4a7..53d8de2 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -185,7 +182,7 @@ void FloatType::setEbias( size_t ebias ) const /// \a norm_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_norm_t FloatType::getNorm( string& norm_string ) const +H5T_norm_t FloatType::getNorm( H5_std::string& norm_string ) const { H5T_norm_t norm = H5Tget_norm( id ); // C routine // Returns a valid normalization type if successful @@ -238,7 +235,7 @@ void FloatType::setNorm( H5T_norm_t norm ) const /// \a pad_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_pad_t FloatType::getInpad( string& pad_string ) const +H5T_pad_t FloatType::getInpad( H5_std::string& pad_string ) const { H5T_pad_t pad_type = H5Tget_inpad( id ); // Returns a valid padding type if successful diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index c80391f..b2ee0ea 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -41,19 +41,19 @@ class H5_DLLCPP FloatType : public AtomType { void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; // Retrieves the internal padding type for unused bits in floating-point datatypes. - H5T_pad_t getInpad( string& pad_string ) const; + H5T_pad_t getInpad( H5_std::string& pad_string ) const; // Fills unused internal floating point bits. void setInpad( H5T_pad_t inpad ) const; // Retrieves mantissa normalization of a floating-point datatype. - H5T_norm_t getNorm( string& norm_string ) const; + H5T_norm_t getNorm( H5_std::string& norm_string ) const; // Sets the mantissa normalization of a floating-point datatype. void setNorm( H5T_norm_t norm ) const; // Returns this class name - virtual string fromClass () const { return("FloatType"); } + virtual H5_std::string fromClass () const { return("FloatType"); } // Default constructor FloatType(); diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 5837d7b..466e9d5 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -136,7 +133,7 @@ void* Group::Reference(const char* name) const ///\param name - IN: Name of the object to be referenced // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void* Group::Reference(const string& name) const +void* Group::Reference(const H5_std::string& name) const { return(Reference(name.c_str())); } @@ -216,9 +213,9 @@ void Group::close() // implementation of Group. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Group::throwException(const string func_name, const string msg) const +void Group::throwException(const H5_std::string func_name, const H5_std::string msg) const { - string full_name = func_name; + H5_std::string full_name = func_name; full_name.insert(0, "Group::"); throw GroupIException(full_name, msg); } diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index fda98d1..43be390 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -37,13 +37,13 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Creates a reference to a named Hdf5 object in this object. void* Reference(const char* name) const; - void* Reference(const string& name) const; + void* Reference(const H5_std::string& name) const; // Returns this class name - virtual string fromClass () const { return("Group"); } + virtual H5_std::string fromClass () const { return("Group"); } // Throw group exception. - virtual void throwException(const string func_name, const string msg) const; + virtual void throwException(const H5_std::string func_name, const H5_std::string msg) const; // for CommonFG to get the file id. virtual hid_t getLocId() const; diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 3063d6b..7e8587a 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -16,12 +16,9 @@ #endif /*H5_VMS*/ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; #ifdef H5_VMS using std::count; #endif /*H5_VMS*/ -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -266,14 +263,14 @@ IdComponent::~IdComponent() { /// an exception is thrown. // Programmer Binh-Minh Ribler - Aug 6, 2005 //-------------------------------------------------------------------------- -string IdComponent::inMemFunc(const char* func_name) const +H5_std::string IdComponent::inMemFunc(const char* func_name) const { #ifdef H5_VMS - string full_name = fromClass(); + H5_std::string full_name = fromClass(); full_name.append("::"); full_name.append(func_name); #else - string full_name = func_name; + H5_std::string full_name = func_name; full_name.insert(0, "::"); full_name.insert(0, fromClass()); #endif /*H5_VMS*/ @@ -297,7 +294,7 @@ IdComponent::IdComponent() : id(-1) {} // H5File and H5Object subclasses. // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- -string IdComponent::p_get_file_name() const +H5_std::string IdComponent::p_get_file_name() const { // Preliminary call to H5Fget_name to get the length of the file name ssize_t name_size = H5Fget_name(id, NULL, 0); @@ -319,7 +316,7 @@ string IdComponent::p_get_file_name() const } // Convert the C file name and return - string file_name(name_C); + H5_std::string file_name(name_C); delete []name_C; return(file_name); } diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 431863b..25aeb1e 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -20,9 +20,6 @@ #ifndef H5_NO_NAMESPACE namespace H5 { -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif class H5_DLLCPP IdComponent { @@ -64,10 +61,10 @@ class H5_DLLCPP IdComponent { // Makes and returns the string "<class-name>::<func_name>"; // <class-name> is returned by fromClass(). - string inMemFunc(const char* func_name) const; + H5_std::string inMemFunc(const char* func_name) const; // Returns this class name. - virtual string fromClass() const { return("IdComponent");} + virtual H5_std::string fromClass() const { return("IdComponent");} #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -82,7 +79,7 @@ class H5_DLLCPP IdComponent { IdComponent(); // Gets the name of the file, in which an HDF5 object belongs. - string p_get_file_name() const; + H5_std::string p_get_file_name() const; // Gets the id of the H5 file in which the given object is located. hid_t p_get_file_id(); diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 3b84832..e5c6e3b 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ed4dbc8..54262fa 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -34,7 +34,7 @@ class H5_DLLCPP IntType : public AtomType { void setSign( H5T_sign_t sign ) const; // Returns this class name - virtual string fromClass () const { return("IntType"); } + virtual H5_std::string fromClass () const { return("IntType"); } // Default constructor IntType(); diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 36711d9..af6b8da 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5CppDoc.h" // included only for Doxygen to generate part of RM diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 3d0c6f5..073c3d3 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -41,7 +38,7 @@ namespace H5 { // problem. May be moved to Iterator later. extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data ) { - string s_attr_name = string( attr_name ); + H5_std::string s_attr_name = H5_std::string( attr_name ); #ifdef NO_STATIC_CAST UserData4Aiterate* myData = (UserData4Aiterate *) op_data; #else @@ -127,7 +124,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::createAttribute( const string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const +Attribute H5Object::createAttribute( const H5_std::string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const { return( createAttribute( name.c_str(), data_type, data_space, create_plist )); } @@ -161,7 +158,7 @@ Attribute H5Object::openAttribute( const char* name ) const /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute( const string& name ) const +Attribute H5Object::openAttribute( const H5_std::string& name ) const { return( openAttribute( name.c_str()) ); } @@ -268,7 +265,7 @@ void H5Object::removeAttr( const char* name ) const /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Object::removeAttr( const string& name ) const +void H5Object::removeAttr( const H5_std::string& name ) const { removeAttr( name.c_str() ); } @@ -297,7 +294,7 @@ void H5Object::renameAttr(const char* oldname, const char* newname) const /// a reference to an \c std::string for the names. // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- -void H5Object::renameAttr(const string& oldname, const string& newname) const +void H5Object::renameAttr(const H5_std::string& oldname, const H5_std::string& newname) const { renameAttr (oldname.c_str(), newname.c_str()); } @@ -330,7 +327,7 @@ void H5Object::flush(H5F_scope_t scope ) const ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- -string H5Object::getFileName() const +H5_std::string H5Object::getFileName() const { try { return(p_get_file_name()); diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 8dec714..32551fb 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -32,7 +32,7 @@ class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). typedef void (*attr_operator_t)( H5Object& loc/*in*/, - const string attr_name/*in*/, + const H5_std::string attr_name/*in*/, void *operator_data/*in,out*/); class UserData4Aiterate { // user data for attribute iteration @@ -51,11 +51,11 @@ class H5_DLLCPP H5Object : public IdComponent { // Creates an attribute for a group, dataset, or named datatype. // PropList is currently not used, so always be default. Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - Attribute createAttribute( const string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + Attribute createAttribute( const H5_std::string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; // Opens an attribute given its name. Attribute openAttribute( const char* name ) const; - Attribute openAttribute( const string& name ) const; + Attribute openAttribute( const H5_std::string& name ) const; // Opens an attribute given its index. Attribute openAttribute( const unsigned int idx ) const; @@ -64,7 +64,7 @@ class H5_DLLCPP H5Object : public IdComponent { void flush( H5F_scope_t scope ) const; // Gets the name of the file, in which this HDF5 object belongs. - string getFileName() const; + H5_std::string getFileName() const; // Determines the number of attributes attached to this object. int getNumAttrs() const; @@ -74,11 +74,11 @@ class H5_DLLCPP H5Object : public IdComponent { // Removes the named attribute from this object. void removeAttr( const char* name ) const; - void removeAttr( const string& name ) const; + void removeAttr( const H5_std::string& name ) const; // Renames the attribute to a new name. void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const string& oldname, const string& newname) const; + void renameAttr(const H5_std::string& oldname, const H5_std::string& newname) const; // Copy constructor: makes copy of an H5Object object. H5Object(const H5Object& original); diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index fc18d73..69aae2a 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -238,7 +235,7 @@ void PredType::commit( H5Object& loc, const char* name ) throw DataTypeIException("PredType::commit", "Attempting to commit a predefined datatype. This operation is invalid" ); } -void PredType::commit( H5Object& loc, const string& name ) +void PredType::commit( H5Object& loc, const H5_std::string& name ) { commit( loc, name.c_str()); } diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 7de02c5..85677fa 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -28,7 +28,7 @@ namespace H5 { class H5_DLLCPP PredType : public AtomType { public: // Returns this class name - virtual string fromClass () const { return("PredType"); } + virtual H5_std::string fromClass () const { return("PredType"); } // Makes a copy of the predefined type and stores the new // id in the left hand side object. @@ -181,7 +181,7 @@ class H5_DLLCPP PredType : public AtomType { #ifndef DOXYGEN_SHOULD_SKIP_THIS // These dummy functions do not inherit from DataType - they'll // throw a DataTypeIException if invoked. - void commit( H5Object& loc, const string& name ); + void commit( H5Object& loc, const H5_std::string& name ); void commit( H5Object& loc, const char* name ); bool committed(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index e8f51a5..80c1300 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -20,9 +20,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" @@ -162,7 +159,7 @@ void PropList::copyProp(PropList& dest, const char *name) const ///\param name - IN: Name of the property to copy - \c std::string // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, const string& name ) const +void PropList::copyProp( PropList& dest, const H5_std::string& name ) const { copyProp( dest, name.c_str()); } @@ -199,7 +196,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const ///\param name - IN: Name of the property to copy - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, PropList& src, const string& name ) const +void PropList::copyProp( PropList& dest, PropList& src, const H5_std::string& name ) const { copyProp( dest, src, name.c_str()); } @@ -280,7 +277,7 @@ bool PropList::propExist(const char* name ) const ///\param name - IN: Name of property to check for - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const string& name ) const +bool PropList::propExist(const H5_std::string& name ) const { return( propExist( name.c_str()) ); } @@ -334,7 +331,7 @@ void PropList::getProperty(const char* name, void* value) const ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -string PropList::getProperty(const char* name) const +H5_std::string PropList::getProperty(const char* name) const { size_t size = getPropSize(name); char* prop_strg_C = new char[size+1]; // temporary C-string for C API @@ -347,7 +344,7 @@ string PropList::getProperty(const char* name) const } // Return propety value as a string after deleting temp C-string - string prop_strg = string(prop_strg_C); + H5_std::string prop_strg = H5_std::string(prop_strg_C); delete []prop_strg_C; return (prop_strg); } @@ -360,7 +357,7 @@ string PropList::getProperty(const char* name) const ///\param value - OUT: Pointer to the buffer for the property value // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void PropList::getProperty(const string& name, void* value) const +void PropList::getProperty(const H5_std::string& name, void* value) const { getProperty(name.c_str(), value); } @@ -373,7 +370,7 @@ void PropList::getProperty(const string& name, void* value) const ///\return The property that is a \c std::string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -string PropList::getProperty(const string& name) const +H5_std::string PropList::getProperty(const H5_std::string& name) const { return (getProperty(name.c_str())); } @@ -410,7 +407,7 @@ size_t PropList::getPropSize(const char *name) const /// // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -size_t PropList::getPropSize(const string& name) const +size_t PropList::getPropSize(const H5_std::string& name) const { return (getPropSize(name.c_str())); } @@ -422,14 +419,14 @@ size_t PropList::getPropSize(const string& name) const /// a NULL string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -string PropList::getClassName() const +H5_std::string PropList::getClassName() const { char* temp_str; temp_str = H5Pget_class_name(id); if (temp_str != NULL) { - string class_name = string(temp_str); + H5_std::string class_name = H5_std::string(temp_str); free(temp_str); return(class_name); } @@ -496,7 +493,7 @@ void PropList::setProperty(const char* name, const char* charptr) const ///\param strg - IN: Value for the property is a \c std::string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void PropList::setProperty(const char* name, string& strg) const +void PropList::setProperty(const char* name, H5_std::string& strg) const { setProperty(name, strg.c_str()); } @@ -510,7 +507,7 @@ void PropList::setProperty(const char* name, string& strg) const ///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void PropList::setProperty(const string& name, void* value) const +void PropList::setProperty(const H5_std::string& name, void* value) const { setProperty(name.c_str(), value); } @@ -524,7 +521,7 @@ void PropList::setProperty(const string& name, void* value) const ///\param strg - IN: Value for the property is a \c std::string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void PropList::setProperty(const string& name, string& strg) const +void PropList::setProperty(const H5_std::string& name, H5_std::string& strg) const { setProperty(name.c_str(), strg.c_str()); } @@ -576,7 +573,7 @@ void PropList::removeProp(const char *name) const ///\param name - IN: Name of property to remove - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void PropList::removeProp(const string& name) const +void PropList::removeProp(const H5_std::string& name) const { removeProp(name.c_str()); } diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 642c046..02adf44 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -46,18 +46,18 @@ class H5_DLLCPP PropList : public IdComponent { // Copies a property from this property list or class to another void copyProp( PropList& dest, const char* name) const; - void copyProp( PropList& dest, const string& name) const; + void copyProp( PropList& dest, const H5_std::string& name) const; // Copies a property from one property list or property class to another void copyProp( PropList& dest, PropList& src, const char* name) const; - void copyProp( PropList& dest, PropList& src, const string& name) const; + void copyProp( PropList& dest, PropList& src, const H5_std::string& name) const; // Gets the class of this property list, i.e. H5P_FILE_CREATE, // H5P_FILE_ACCESS, ... hid_t getClass() const; // Return the name of a generic property list class. - string getClassName() const; + H5_std::string getClassName() const; // Returns the parent class of a generic property class. PropList getClassParent() const; @@ -67,34 +67,34 @@ class H5_DLLCPP PropList : public IdComponent { // Query the value of a property in a property list. void getProperty(const char* name, void* value) const; - string getProperty(const char* name) const; - void getProperty(const string& name, void* value) const; - string getProperty(const string& name) const; + H5_std::string getProperty(const char* name) const; + void getProperty(const H5_std::string& name, void* value) const; + H5_std::string getProperty(const H5_std::string& name) const; // Set a property's value in a property list. void setProperty(const char* name, void* charptr) const; void setProperty(const char* name, const char* value) const; - void setProperty(const char* name, string& strg) const; - void setProperty(const string& name, void* value) const; - void setProperty(const string& name, string& strg) const; + void setProperty(const char* name, H5_std::string& strg) const; + void setProperty(const H5_std::string& name, void* value) const; + void setProperty(const H5_std::string& name, H5_std::string& strg) const; // Query the size of a property in a property list or class. size_t getPropSize(const char *name) const; - size_t getPropSize(const string& name) const; + size_t getPropSize(const H5_std::string& name) const; // Determines whether a property list is a certain class. bool isAClass(const PropList& prop_class) const; /// Query the existance of a property in a property object. bool propExist(const char* name) const; - bool propExist(const string& name) const; + bool propExist(const H5_std::string& name) const; // Removes a property from a property list. void removeProp(const char *name) const; - void removeProp(const string& name) const; + void removeProp(const H5_std::string& name) const; // Returns this class name - virtual string fromClass () const { return("PropList"); } + virtual H5_std::string fromClass () const { return("PropList"); } // Default constructor: creates a stub PropList object. PropList(); diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index f76406a..1cfb114 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 80ebbe4..2553b45 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -47,7 +47,7 @@ class H5_DLLCPP StrType : public AtomType { void setStrpad(H5T_str_t strpad) const; // Returns this class name - virtual string fromClass () const { return("StrType"); } + virtual H5_std::string fromClass () const { return("StrType"); } // default constructor StrType(); diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index b8f2d32..c7d3dc8 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -14,9 +14,6 @@ #include <string> #ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::string; -#endif // H5_NO_STD #endif #include "H5Include.h" diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index e4e7959..eaa0d93 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -29,7 +29,7 @@ class H5_DLLCPP VarLenType : public DataType { VarLenType(const DataType* base_type); // Returns this class name - virtual string fromClass () const { return("VarLenType"); } + virtual H5_std::string fromClass () const { return("VarLenType"); } // Copy constructor: makes copy of the original object. VarLenType( const VarLenType& original ); diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index f6eb35e..aaab3e2 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -33,7 +33,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cerr; using std::endl; #endif // H5_NO_STD @@ -43,7 +42,8 @@ #include "H5Cpp.h" // C++ API header file #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index 1d320ca..a711f81 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -29,20 +29,21 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cerr; using std::endl; #endif // H5_NO_STD #endif #include "h5test.h" -#include "H5Exception.h" -#include "h5cpputil.h" +#include "H5Cpp.h" #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif +#include "h5cpputil.h" + /*------------------------------------------------------------------------- * Function: test_report diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index b6601db..abd076a 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -30,13 +30,12 @@ using namespace H5; #endif #ifndef H5_NO_STD -int test_report (int, const std::string&); using std::cerr; using std::endl; -#else -int test_report (int, const string&); #endif +int test_report (int, const string&); + void issue_fail_msg(const char* where, int line, const char* file_name, const char* message=""); diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index aed8a93..73c7390 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -24,12 +24,12 @@ #else #include <iostream> #endif - #include <string> #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; + using std::cerr; + using std::endl; #endif // H5_NO_STD #endif @@ -37,7 +37,8 @@ #include "H5Cpp.h" // C++ API header file #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index c275a82..1951a99 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -42,10 +42,8 @@ ***************************************************************************/ -// Use C version of the header file testhdf5.h instead of re-coding it -#include "testhdf5.h" - -#include "H5Cpp.h" +#include "testhdf5.h" // C test header file +#include "H5Cpp.h" // C++ API header file #ifndef H5_NO_NAMESPACE using namespace H5; diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 8910408..3541c2a 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -31,7 +31,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cerr; using std::endl; #endif // H5_NO_STD @@ -41,7 +40,8 @@ #include "H5Cpp.h" // C++ API header file #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index d8cdb0b..b54d89f 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -30,7 +30,6 @@ #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD - using std::string; using std::cerr; using std::endl; #endif // H5_NO_STD @@ -40,7 +39,8 @@ #include "H5Cpp.h" // C++ API header file #ifndef H5_NO_NAMESPACE -using namespace H5; + using namespace H5; + using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file |