本文整理汇总了C++中util::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ util::contains方法的具体用法?C++ util::contains怎么用?C++ util::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contains
inline bool
protocolled (TY val2check)
{
return contains ( command2::check_.str()
, lexical_cast<string> (val2check)
);
}
示例2: testSession
virtual void
run (Arg)
{
// Prepare an (test)Index (dummy "session")
PPIdx testSession (build_testScopes());
ElementQuery queryAPI;
MORef<DummyMO> dummy1 = queryAPI.pick (elementID_contains("MO2"));
CHECK (dummy1);
CHECK (dummy1->isValid());
INFO (test, "Location in Tree: %s", cStr(ScopePath(dummy1.getPlacement())));
string elementID = dummy1->operator string();
CHECK (contains (elementID, "MO2"));
string specificID = elementID.substr(10); // should contain the random int-ID
MORef<DummyMO> dummy2;
CHECK (!dummy2);
dummy2 = queryAPI.pick (elementID_contains(specificID));
CHECK (dummy2); // found the same object again
CHECK (dummy2->isValid());
CHECK (dummy2 == dummy1);
// put aside a new handle holding onto the MObject
PDum newPlacement(dummy1.getPlacement());
CHECK (testSession->contains(dummy1));
CHECK (!testSession->contains(newPlacement));
// and now remove the placement and all contained elements
testSession->clear (dummy1);
CHECK (!testSession->contains(dummy1));
MORef<DummyMO> findAgain = queryAPI.pick (elementID_contains(specificID));
CHECK (!findAgain); // empty result because searched element was removed from session...
MORef<DummyMO> otherElm = queryAPI.pick (elementID_contains("MO21"));
CHECK (otherElm); // now pick just some other arbitrary element
testSession->insert(newPlacement, otherElm);
dummy2 = queryAPI.pick (elementID_contains(specificID));
CHECK (dummy2);
CHECK (dummy2 != dummy1);
CHECK (dummy2 != newPlacement);
CHECK (isSharedPointee(newPlacement, dummy2.getPlacement()));
CHECK (Scope::containing (dummy2.getRef()) == Scope (otherElm));
INFO (test, "New treelocation: %s", cStr(ScopePath(dummy2.getPlacement())));
}
示例3: resetLayout
void DialogEditGPR::setupEntriesAndLabels()
{
resetLayout();
switch(bitSize_)
{
case 8:
hideColumn(GPR8H_COL);
hideColumn(GPR16_COL);
case 16:
hideColumn(GPR32_COL);
case 32:
hideColumn(GPR64_COL);
case 64:
break;
default:
Q_ASSERT("Unsupported bitSize" && 0);
}
const QString regName=reg.name().toUpper();
if(bitSize_==64)
columnLabel(GPR64_COL)->setText(regName);
else if(bitSize_==32)
columnLabel(GPR32_COL)->setText(regName);
else if(bitSize_==16)
columnLabel(GPR16_COL)->setText(regName);
else
columnLabel(GPR8L_COL)->setText(regName);
static const auto x86GPRsWithHighBytesAddressable=util::make_array<QString>("EAX","ECX","EDX","EBX","RAX","RCX","RDX","RBX");
static const auto x86GPRsWithHighBytesNotAddressable=util::make_array<QString>("ESP","EBP","ESI","EDI","RSP","RBP","RSI","RDI");
static const auto upperGPRs64=util::make_array<QString>("R8","R9","R10","R11","R12","R13","R14","R15");
bool x86GPR=false, upperGPR64=false;
using util::contains;
if(contains(x86GPRsWithHighBytesNotAddressable,regName))
{
x86GPR=true;
hideColumn(GPR8H_COL);
if(bitSize_==32)
{
hideColumn(GPR8L_COL); // In 32 bit mode low bytes also can't be addressed
hideRow(CHAR_ROW);
}
}
else if(contains(x86GPRsWithHighBytesAddressable,regName))
x86GPR=true;
else if(contains(upperGPRs64,regName))
upperGPR64=true;
if(x86GPR)
{
if(bitSize_==64)
columnLabel(GPR32_COL)->setText("E"+regName.mid(1));
columnLabel(GPR16_COL)->setText(regName.mid(1));
columnLabel(GPR8H_COL)->setText(regName.mid(1,1)+"H");
if(bitSize_==64 && !contains(x86GPRsWithHighBytesAddressable,regName))
columnLabel(GPR8L_COL)->setText(regName.mid(1)+"L");
else
columnLabel(GPR8L_COL)->setText(regName.mid(1,1)+"L");
}
else if(upperGPR64)
{
columnLabel(GPR32_COL)->setText(regName+"D");
columnLabel(GPR16_COL)->setText(regName+"W");
columnLabel(GPR8L_COL)->setText(regName+"B");
hideColumn(GPR8H_COL);
}
else
{
// These have hex only format
hideColumn(GPR8H_COL);
if(bitSize_!=8)
hideColumn(GPR8L_COL);
if(bitSize_!=16)
hideColumn(GPR16_COL);
if(bitSize_!=32)
hideColumn(GPR32_COL);
hideRow(SIGNED_ROW);
hideRow(UNSIGNED_ROW);
hideRow(CHAR_ROW);
}
}