本文整理汇总了C++中StringBuilder::TruncateLeftBy方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBuilder::TruncateLeftBy方法的具体用法?C++ StringBuilder::TruncateLeftBy怎么用?C++ StringBuilder::TruncateLeftBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder::TruncateLeftBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readDefinition
void RotLibConvert_Dunbrack_BBInd::readDefinition( StringBuilder& sb, RotamerLibrary& _RotLib ) const
{
ASSERT( sb.size() >= 67, ParseException, "String too short to parse!!");
StringBuilder resname(3);
resname.setTo( sb, 0, 3 );
sb.TruncateLeftBy(18);
int pdbCount = sb.parseInt(0,7);
if( pdbCount == 0 )
return;
double probability = sb.parseDouble(7,8);
sb.TruncateLeftBy(37);
std::vector<double> importChis;
std::vector<std::string> parts = sb.tokenise();
ASSERT( (parts.size() % 2 == 0), ParseException, "Unexpected element count");
for( size_t i = 0; i < parts.size(); i+=2 )
{
double chi;
ASSERT( 0 == str2double( parts[i], chi ), ParseException, "Error parsing chi def");
importChis.push_back(Maths::DegToRad(chi));
}
ASSERT( importChis.size() != 0, ParseException, "No chis found!!");
_RotLib.addRotamer( resname.toString(), importChis, ConstantProbability( probability ) );
}
示例2: pdbPathToStem
std::string pdbPathToStem( const std::string& pdbPath, int startRes, int length, int branchNum, int execID )
{
StringBuilder stem;
stem.append(execID);
stem.append('_');
stem.append( pdbPath );
size_t at;
while( SIZE_T_FAIL != (at = stem.FirstOf('/') ) )
{
stem.replace( at, '\\' );
}
at = stem.LastOf( '\\' );
if( at != SIZE_T_FAIL )
stem.TruncateLeftBy( at + 1 );
at = stem.FirstOf( '.' );
if( at != SIZE_T_FAIL )
stem.TruncateRightTo( at );
stem.append('_');
stem.append(startRes);
stem.append('_');
stem.append(length);
stem.append('_');
stem.append(branchNum);
return stem.toString();
}