本文整理汇总了C++中CItemData::NumberUnknownFields方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::NumberUnknownFields方法的具体用法?C++ CItemData::NumberUnknownFields怎么用?C++ CItemData::NumberUnknownFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemData
的用法示例。
在下文中一共展示了CItemData::NumberUnknownFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Compare
//.........这里部分代码省略.........
// Don't test policy or symbols if either entry is using a named policy
// as these are meaningless to compare
if (currentItem.GetPolicyName().empty() && compItem.GetPolicyName().empty()) {
if (bsFields.test(CItemData::POLICY)) {
PWPolicy cur_pwp, cmp_pwp;
if (currentItem.GetPWPolicy().empty())
cur_pwp = PWSprefs::GetInstance()->GetDefaultPolicy();
else
currentItem.GetPWPolicy(cur_pwp);
if (compItem.GetPWPolicy().empty())
cmp_pwp = PWSprefs::GetInstance()->GetDefaultPolicy(true);
else
compItem.GetPWPolicy(cmp_pwp);
if (cur_pwp != cmp_pwp)
bsConflicts.flip(CItemData::POLICY);
}
CompareField(CItemData::SYMBOLS, bsFields, currentItem, compItem, bsConflicts);
}
CompareField(CItemData::RUNCMD, bsFields, currentItem, compItem, bsConflicts);
CompareField(CItemData::DCA, bsFields, currentItem, compItem, bsConflicts);
CompareField(CItemData::SHIFTDCA, bsFields, currentItem, compItem, bsConflicts);
CompareField(CItemData::EMAIL, bsFields, currentItem, compItem, bsConflicts);
CompareField(CItemData::PROTECTED, bsFields, currentItem, compItem, bsConflicts);
if (bsFields.test(CItemData::KBSHORTCUT) &&
currentItem.GetKBShortcut() != compItem.GetKBShortcut())
bsConflicts.flip(CItemData::KBSHORTCUT);
st_data.uuid0 = currentPos->first;
st_data.uuid1 = foundPos->first;
st_data.bsDiffs = bsConflicts;
st_data.indatabase = BOTH;
st_data.unknflds0 = currentItem.NumberUnknownFields() > 0;
st_data.unknflds1 = compItem.NumberUnknownFields() > 0;
st_data.bIsProtected0 = currentItem.IsProtected();
if (bsConflicts.any()) {
numConflicts++;
st_data.id = numConflicts;
list_Conflicts.push_back(st_data);
} else {
numIdentical++;
st_data.id = numIdentical;
list_Identical.push_back(st_data);
}
} else {
// didn't find any match...
numOnlyInCurrent++;
st_data.uuid0 = currentPos->first;
st_data.uuid1 = CUUID::NullUUID();
st_data.bsDiffs.reset();
st_data.indatabase = CURRENT;
st_data.unknflds0 = currentItem.NumberUnknownFields() > 0;
st_data.unknflds1 = false;
st_data.id = numOnlyInCurrent;
list_OnlyInCurrent.push_back(st_data);
}
}
} // iteration over our entries
ItemListIter compPos;
for (compPos = pothercore->GetEntryIter();
compPos != pothercore->GetEntryEndIter();
compPos++) {
// See if user has cancelled
示例2: PassesFiltering
bool PWSFilterManager::PassesFiltering(const CItemData &ci, const PWScore &core)
{
bool thistest_rc;
bool bValue(false);
bool bFilterForStatus(false), bFilterForType(false);
const CItemData *pci;
if (!m_currentfilter.IsActive())
return true;
const CItemData::EntryType entrytype = ci.GetEntryType();
for (auto groups_iter = m_vMflgroups.begin();
groups_iter != m_vMflgroups.end(); groups_iter++) {
const vfiltergroup &group = *groups_iter;
int tests(0);
bool thisgroup_rc = false;
for (auto iter = group.begin();
iter != group.end(); iter++) {
const int &num = *iter;
if (num == -1) // Padding to ensure group size is correct for FT_PWHIST & FT_POLICY
continue;
const st_FilterRow &st_fldata = m_currentfilter.vMfldata.at(num);
thistest_rc = false;
PWSMatch::MatchType mt(PWSMatch::MT_INVALID);
const FieldType ft = m_currentfilter.vMfldata[num].ftype;
const int ifunction = (int)st_fldata.rule;
switch (ft) {
case FT_GROUPTITLE:
case FT_GROUP:
case FT_TITLE:
case FT_USER:
case FT_NOTES:
case FT_URL:
case FT_AUTOTYPE:
case FT_RUNCMD:
case FT_EMAIL:
case FT_SYMBOLS:
case FT_POLICYNAME:
mt = PWSMatch::MT_STRING;
break;
case FT_PASSWORD:
mt = PWSMatch::MT_PASSWORD;
break;
case FT_DCA:
mt = PWSMatch::MT_DCA;
break;
case FT_SHIFTDCA:
mt = PWSMatch::MT_SHIFTDCA;
break;
case FT_CTIME:
case FT_PMTIME:
case FT_ATIME:
case FT_XTIME:
case FT_RMTIME:
mt = PWSMatch::MT_DATE;
break;
case FT_PWHIST:
mt = PWSMatch::MT_PWHIST;
break;
case FT_POLICY:
mt = PWSMatch::MT_POLICY;
break;
case FT_XTIME_INT:
mt = PWSMatch::MT_INTEGER;
break;
case FT_KBSHORTCUT:
bValue = !ci.GetKBShortcut().empty();
mt = PWSMatch::MT_BOOL;
break;
case FT_UNKNOWNFIELDS:
bValue = ci.NumberUnknownFields() > 0;
mt = PWSMatch::MT_BOOL;
break;
case FT_PROTECTED:
bValue = ci.IsProtected();
mt = PWSMatch::MT_BOOL;
break;
case FT_PASSWORDLEN:
mt = PWSMatch::MT_INTEGER;
break;
case FT_ENTRYTYPE:
mt = PWSMatch::MT_ENTRYTYPE;
break;
case FT_ENTRYSTATUS:
mt = PWSMatch::MT_ENTRYSTATUS;
break;
case FT_ENTRYSIZE:
mt = PWSMatch::MT_ENTRYSIZE;
break;
case FT_ATTACHMENT:
mt = PWSMatch::MT_ATTACHMENT;
break;
default:
ASSERT(0);
}
//.........这里部分代码省略.........