本文整理汇总了C++中LString::startsWith方法的典型用法代码示例。如果您正苦于以下问题:C++ LString::startsWith方法的具体用法?C++ LString::startsWith怎么用?C++ LString::startsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LString
的用法示例。
在下文中一共展示了LString::startsWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeSecstr
void PDBFileWriter::writeSecstr(qlib::PrintStream &prs)
{
MolResiduePtr pRes1;
int nhx = 1;
MolCoordPtr pMol(m_pMol);
ResidIterator riter(pMol); //(MolCoordPtr(m_pMol));
// Write HELIX records
for (riter.first(); riter.hasMore(); riter.next()) {
LString sec;
LString pfx;
MolResiduePtr pRes = riter.get();
pRes->getPropStr("secondary2", sec);
// MB_DPRINTLN("%s%d => %s", pRes->getChainName().c_str(), pRes->getIndex().first, sec.c_str());
if (sec.length()>=2)
pfx= sec.substr(1,1);
if (!(sec.startsWith("H")||sec.startsWith("G")||sec.startsWith("I")))
continue;
if (pfx.equals("s"))
pRes1 = pRes;
else if (pfx.equals("e")) {
LString resn1 = pRes1->getName().substr(0,3);
LString chn1 = pRes1->getChainName().substr(0,1);
ResidIndex resix1 = pRes1->getIndex();
char ins1 = resix1.second;
if (ins1=='\0') ins1 = ' ';
LString resn2 = pRes->getName().substr(0,3);
LString chn2 = pRes->getChainName().substr(0,1);
ResidIndex resix2 = pRes->getIndex();
char ins2 = resix2.second;
if (ins2=='\0') ins2 = ' ';
prs.print("HELIX ");
// helix seqno
prs.format(" %3d", nhx);
// helix ID
prs.format(" %3d", nhx);
// start resname
prs.format(" %3s", resn1.c_str());
prs.format(" %1s", chn1.c_str());
prs.format(" %4d", resix1.first);
prs.format("%c", ins1);
// end resname
prs.format(" %3s", resn2.c_str());
prs.format(" %1s", chn2.c_str());
prs.format(" %4d", resix2.first);
prs.format("%c", ins2);
// typeof helix
int ntype = 1;
if (sec.startsWith("G"))
ntype = 5;
else if (sec.startsWith("I"))
ntype = 3;
prs.format("%2d", ntype);
prs.println("");
++nhx;
}
}
// Write SHEET records
int nsh = 1;
for (riter.first(); riter.hasMore(); riter.next()) {
LString sec;
LString pfx;
MolResiduePtr pRes = riter.get();
pRes->getPropStr("secondary2", sec);
// MB_DPRINTLN("%s%d => %s", pRes->getChainName().c_str(), pRes->getIndex().first, sec.c_str());
if (sec.length()>=2)
pfx= sec.substr(1,1);
if (!(sec.startsWith("E")))
continue;
if (pfx.equals("s"))
pRes1 = pRes;
else if (pfx.equals("e")) {
LString resn1 = pRes1->getName().substr(0,3);
LString chn1 = pRes1->getChainName().substr(0,1);
ResidIndex resix1 = pRes1->getIndex();
char ins1 = resix1.second;
if (ins1=='\0') ins1 = ' ';
LString resn2 = pRes->getName().substr(0,3);
LString chn2 = pRes->getChainName().substr(0,1);
ResidIndex resix2 = pRes->getIndex();
char ins2 = resix2.second;
if (ins2=='\0') ins2 = ' ';
//.........这里部分代码省略.........
示例2: procDataSrcLoad
void SceneXMLReader::procDataSrcLoad(qlib::LDom2InStream &ois, LDom2Node *pNode)
{
//////////
// Recursively check the data src load requests
LDom2Node::NodeList::const_iterator iter = pNode->childBegin();
LDom2Node::NodeList::const_iterator eiter = pNode->childEnd();
for (; iter!=eiter; ++iter) {
LDom2Node *pChNode = *iter;
if (pChNode!=NULL)
procDataSrcLoad(ois, pChNode);
}
//////////
// Do data source loading
LDataSrcContainer *pCnt = pNode->getDataSrcContainer();
if (pCnt==NULL)
return;
LString src = pNode->getDataSrc();
LString altsrc = pNode->getDataAltSrc();
LString srctype = pNode->getDataSrcType();
if (src.isEmpty())
return;
if (srctype.isEmpty()) {
// ERROR!! (TO DO: handling)
LOG_DPRINTLN("SceneXML> src %s: srctype is not defined. (ignored)", src.c_str());
return;
}
if (src.startsWith("datachunk:") && src.length()==15) {
// Data source is in datachunk
// --> Prepare for reading from data chunk of the stream
MB_DPRINTLN("Data chunk found %s, %s ",
src.c_str(), srctype.c_str());
// addChunkMap(src, pCnt, srctype);
ois.addChunkMap(src, pCnt);
return;
}
//robj->readFromPath(src, altsrc, m_pClient);
bool bAlt = false;
LString basedir = m_pClient->getBasePath();
LString abs_path = pCnt->readFromSrcAltSrc(src, altsrc, basedir, bAlt);
// ATTN 14/06/29:
// Update src/altsrc properties based on where the data source has been loaded.
// (In the qsc file, there are two alternative sources. However, only one src is actually loaded.)
// This is required to keep consistency between the "src prop" and "actual data src".
if (bAlt) {
// loaded from altsrc; altsrc --> src
if (!qlib::isAbsolutePath(altsrc))
altsrc = qlib::makeAbsolutePath(altsrc, basedir);
pCnt->updateSrcPath(altsrc);
}
else {
// loaded from src; keep src
if (!qlib::isAbsolutePath(src))
src = qlib::makeAbsolutePath(src, basedir);
pCnt->updateSrcPath(src);
}
}