本文整理汇总了C++中H5std_string::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ H5std_string::c_str方法的具体用法?C++ H5std_string::c_str怎么用?C++ H5std_string::c_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类H5std_string
的用法示例。
在下文中一共展示了H5std_string::c_str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unlink
//--------------------------------------------------------------------------
// Function: CommonFG::unlink
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CommonFG::unlink( const H5std_string& name ) const
{
unlink( name.c_str() );
}
示例2: return
//--------------------------------------------------------------------------
// Function: H5File::isHdf5
///\brief This is an overloaded member function, provided for convenience.
/// It takes an \c H5std_string for \a name. (Static)
///\param name - IN: Name of the file - \c H5std_string
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const H5std_string& name )
{
return( isHdf5( name.c_str()) );
}
示例3:
//--------------------------------------------------------------------------
// Function: H5File overloaded constructor
///\brief This is another overloaded constructor. It differs from the
/// above constructor only in the type of the \a name argument.
///\param name - IN: Name of the file - \c H5std_string
///\param flags - IN: File access flags
///\param create_plist - IN: File creation property list, used when
/// modifying default file meta-data. Default to
/// FileCreatPropList::DEFAULT
///\param access_plist - IN: File access property list. Default to
/// FileCreatPropList::DEFAULT
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(0)
{
p_get_file(name.c_str(), flags, create_plist, access_plist);
}
示例4: getPropSize
//--------------------------------------------------------------------------
// Function: PropList::getPropSize
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to query - \c H5std_string
///
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t PropList::getPropSize(const H5std_string& name) const
{
return (getPropSize(name.c_str()));
}
示例5: setProperty
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to set - \c H5std_string
///\param strg - IN: Value for the property is a \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::setProperty(const H5std_string& name, H5std_string& strg) const
{
setProperty(name.c_str(), strg.c_str());
}
示例6: test_file_create
/*-------------------------------------------------------------------------
* Function: test_file_create
*
* Purpose: Test file and template creations
*
* Return: None
*
* Programmer: Binh-Minh Ribler (use C version)
* January, 2001
*
* Modifications:
* January, 2005: C tests' macro VERIFY casts values to 'long' for all
* cases. Since there are no operator<< for 'long long'
* or int64 in VS C++ ostream, I casted the hsize_t values
* passed to verify_val to 'long' as well. If problems
* arises later, this will have to be specificly handled
* with a special routine.
*
*-------------------------------------------------------------------------
*/
static void test_file_create()
{
// Output message about test being performed
SUBTEST("File Creation I/O");
// Test create with various sequences of H5F_ACC_EXCL and
// H5F_ACC_TRUNC flags
// Create with H5F_ACC_EXCL
// First ensure the file does not exist
remove(FILE1.c_str());
// Setting this to NULL for cleaning up in failure situations
H5File* file1 = NULL;
try {
// Create file FILE1
file1 = new H5File (FILE1, H5F_ACC_EXCL);
// try to create the same file with H5F_ACC_TRUNC. This should fail
// because file1 is the same file and is currently open.
#ifndef H5_HAVE_FILE_VERSIONS
try {
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "Attempted to create an existing file.");
}
catch( FileIException E ) // catch truncating existing file
{} // do nothing, FAIL expected
#endif
// Close file1
delete file1;
file1 = NULL;
// Try again with H5F_ACC_EXCL. This should fail because the file
// already exists from the previous steps.
try {
H5File file2(FILE1, H5F_ACC_EXCL); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "File already exists.");
}
catch( FileIException E ) // catching creating existing file
{} // do nothing, FAIL expected
// Test create with H5F_ACC_TRUNC. This will truncate the existing file.
file1 = new H5File (FILE1, H5F_ACC_TRUNC);
#ifndef H5_HAVE_FILE_VERSIONS
// Try to truncate first file again. This should fail because file1
// is the same file and is currently open.
try {
H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file.");
}
catch( FileIException E ) // catching truncating opened file
{} // do nothing, FAIL expected
#endif
// Try with H5F_ACC_EXCL. This should fail too because the file already
// exists.
try {
H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file.");
}
catch( FileIException E ) // catching H5F_ACC_EXCL on existing file
{} // do nothing, FAIL expected
// Get the file-creation template
FileCreatPropList tmpl1 = file1->getCreatePlist();
hsize_t ublock = tmpl1.getUserblock();
verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__);
size_t parm1, parm2; // file-creation parameters
tmpl1.getSizes( parm1, parm2);
verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
//.........这里部分代码省略.........
示例7: propExist
//--------------------------------------------------------------------------
// Function: PropList::propExist
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// accepts.
///\param name - IN: Name of property to check for - \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
bool PropList::propExist(const H5std_string& name ) const
{
return( propExist( name.c_str()) );
}
示例8: removeComment
//--------------------------------------------------------------------------
// Function: CommonFG::removeComment
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - May 2005
//--------------------------------------------------------------------------
void CommonFG::removeComment(const H5std_string& name) const
{
removeComment (name.c_str());
}
示例9: getComment
//--------------------------------------------------------------------------
// Function: CommonFG::getComment
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5std_string CommonFG::getComment( const H5std_string& name, size_t bufsize ) const
{
return( getComment( name.c_str(), bufsize ));
}
示例10: getLinkval
//--------------------------------------------------------------------------
// Function: CommonFG::getLinkval
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const
{
return( getLinkval( name.c_str(), size ));
}
示例11: setComment
//--------------------------------------------------------------------------
// Function: CommonFG::setComment
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name and \a comment.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CommonFG::setComment( const H5std_string& name, const H5std_string& comment ) const
{
setComment( name.c_str(), comment.c_str() );
}
示例12: getObjinfo
//--------------------------------------------------------------------------
// Function: CommonFG::getObjinfo
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - Nov, 2005
//--------------------------------------------------------------------------
void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const
{
getObjinfo( name.c_str(), statbuf );
}
示例13: move
//--------------------------------------------------------------------------
// Function: CommonFG::move
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a src and \a dst.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const
{
move( src.c_str(), dst.c_str() );
}
示例14: unregister
//--------------------------------------------------------------------------
// Function: DataType::unregister
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in the type of the
/// argument \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const
{
unregister( pers, name.c_str(), dest, func );
}
示例15: mount
//--------------------------------------------------------------------------
// Function: CommonFG::mount
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c std::string for \a name.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CommonFG::mount( const H5std_string& name, H5File& child, PropList& plist ) const
{
mount( name.c_str(), child, plist );
}