本文整理汇总了C++中StdString::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ StdString::begin方法的具体用法?C++ StdString::begin怎么用?C++ StdString::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StdString
的用法示例。
在下文中一共展示了StdString::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inqAttName
//! Query the name of an attribute given a location id, a variable id and the attribute number
int CNetCdfInterface::inqAttName(int ncid, int varid, int attnum, StdString& name)
{
std::vector<char> attName(NC_MAX_NAME + 1,' ');
int status = nc_inq_attname(ncid, varid, attnum, &attName[0]);
if (NC_NOERR != status)
{
StdString errormsg(nc_strerror(status));
StdStringStream sstr;
sstr << "Error when calling function nc_inq_attname(ncid, varid, attnum, attName)" << std::endl;
sstr << errormsg << std::endl;
sstr << "Unable to query the name: " << name << " of attribute " << attnum << " given the location id:" << ncid << " and the variable id:" << varid << std::endl;
StdString e = sstr.str();
throw CNetCdfException(e);
}
int nameSize = 0;
while ((nameSize < NC_MAX_NAME) && (' ' != attName[nameSize] )) ++nameSize;
name.resize(nameSize);
// for (int idx = 0; idx < nameSize; ++idx) name.at(idx) = attName[idx];
std::copy(&attName[0], &attName[nameSize-1], name.begin());
return status;
}
示例2: prepareTablename
StdString SociContainer::prepareTablename(StdString const &oTablename)
{
StdString s;
std::transform(oTablename.begin(), oTablename.end(), s.begin(), ::toupper);
return s;
}