本文整理汇总了C++中CItemData::GetXTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::GetXTime方法的具体用法?C++ CItemData::GetXTime怎么用?C++ CItemData::GetXTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemData
的用法示例。
在下文中一共展示了CItemData::GetXTime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEntryImage
int CCWTreeCtrl::GetEntryImage(const CItemData &ci) const
{
int entrytype = ci.GetEntryType();
if (entrytype == CItemData::ET_ALIAS) {
return ALIAS;
}
if (entrytype == CItemData::ET_SHORTCUT) {
return SHORTCUT;
}
int nImage;
switch (entrytype) {
case CItemData::ET_NORMAL:
nImage = NORMAL;
break;
case CItemData::ET_ALIASBASE:
nImage = ALIASBASE;
break;
case CItemData::ET_SHORTCUTBASE:
nImage = SHORTCUTBASE;
break;
default:
nImage = NORMAL;
}
time_t tttXTime;
ci.GetXTime(tttXTime);
if (tttXTime > time_t(0) && tttXTime <= time_t(3650)) {
time_t tttCPMTime;
ci.GetPMTime(tttCPMTime);
if ((long)tttCPMTime == 0L)
ci.GetCTime(tttCPMTime);
tttXTime = (time_t)((long)tttCPMTime + (long)tttXTime * 86400);
}
if (tttXTime != 0) {
time_t now, warnexptime((time_t)0);
time(&now);
if (PWSprefs::GetInstance()->GetPref(PWSprefs::PreExpiryWarn)) {
int idays = PWSprefs::GetInstance()->GetPref(PWSprefs::PreExpiryWarnDays);
struct tm st;
errno_t err;
err = localtime_s(&st, &now); // secure version
ASSERT(err == 0);
st.tm_mday += idays;
warnexptime = mktime(&st);
if (warnexptime == (time_t)-1)
warnexptime = (time_t)0;
}
if (tttXTime <= now) {
nImage += 2; // Expired
} else if (tttXTime < warnexptime) {
nImage += 1; // Warn nearly expired
}
}
return nImage;
}
示例2: Command
UpdatePasswordCommand::UpdatePasswordCommand(CommandInterface *pcomInt,
CItemData &ci,
const StringX sxNewPassword)
: Command(pcomInt), m_sxNewPassword(sxNewPassword)
{
m_entry_uuid = ci.GetUUID();
m_old_status = ci.GetStatus();
m_sxOldPassword = ci.GetPassword();
m_sxOldPWHistory = ci.GetPWHistory();
ci.GetXTime(m_tttOldXTime);
}
示例3: Add
void ExpiredList::Add(const CItemData &ci)
{
// Not valid for aliases or shortcuts!
if (ci.IsDependent())
return;
// We might be called from Update with a ci
// that doesn't have an expiration date - check!
time_t tttXTime;
ci.GetXTime(tttXTime);
if (tttXTime != time_t(0))
push_back(ExpPWEntry(ci));
}
示例4:
ExpPWEntry::ExpPWEntry(const CItemData &ci)
{
time_t tttXTime;
uuid = ci.GetUUID();
ci.GetXTime(tttXTime);
if (tttXTime > time_t(0) && tttXTime <= time_t(3650)) {
time_t tttCPMTime;
ci.GetPMTime(tttCPMTime);
if (tttCPMTime == time_t(0))
ci.GetCTime(tttCPMTime);
tttXTime = static_cast<time_t>(static_cast<long>(tttCPMTime) + static_cast<long>(tttXTime) * 86400);
}
expirytttXTime = tttXTime;
}
示例5: Merge
//.........这里部分代码省略.........
}
if (otherItem.GetAutoType() != curItem.GetAutoType()) {
diff_flags |= MRG_AUTOTYPE;
LoadAString(str_temp, IDSC_FLDNMAUTOTYPE);
str_diffs += str_temp + _T(", ");
}
if (otherItem.GetPWHistory() != curItem.GetPWHistory()) {
diff_flags |= MRG_HISTORY;
LoadAString(str_temp, IDSC_FLDNMPWHISTORY);
str_diffs += str_temp + _T(", ");
}
// Don't test policy or symbols if either entry is using a named policy
// as these are meaningless to compare
if (otherItem.GetPolicyName().empty() && curItem.GetPolicyName().empty()) {
PWPolicy cur_pwp, oth_pwp;
if (curItem.GetPWPolicy().empty())
cur_pwp = PWSprefs::GetInstance()->GetDefaultPolicy();
else
curItem.GetPWPolicy(cur_pwp);
if (otherItem.GetPWPolicy().empty())
oth_pwp = PWSprefs::GetInstance()->GetDefaultPolicy(true);
else
otherItem.GetPWPolicy(oth_pwp);
if (cur_pwp != oth_pwp) {
diff_flags |= MRG_POLICY;
LoadAString(str_temp, IDSC_FLDNMPWPOLICY);
str_diffs += str_temp + _T(", ");
}
}
otherItem.GetXTime(oxt);
curItem.GetXTime(cxt);
if (oxt != cxt) {
diff_flags |= MRG_XTIME;
LoadAString(str_temp, IDSC_FLDNMXTIME);
str_diffs += str_temp + _T(", ");
}
otherItem.GetXTimeInt(oxtint);
curItem.GetXTimeInt(cxtint);
if (oxtint != cxtint) {
diff_flags |= MRG_XTIME_INT;
LoadAString(str_temp, IDSC_FLDNMXTIMEINT);
str_diffs += str_temp + _T(", ");
}
if (otherItem.GetRunCommand() != curItem.GetRunCommand()) {
diff_flags |= MRG_EXECUTE;
LoadAString(str_temp, IDSC_FLDNMRUNCOMMAND);
str_diffs += str_temp + _T(", ");
}
// Must use integer values not compare strings
short other_hDCA, cur_hDCA;
otherItem.GetDCA(other_hDCA);
curItem.GetDCA(cur_hDCA);
if (other_hDCA != cur_hDCA) {
diff_flags |= MRG_DCA;
LoadAString(str_temp, IDSC_FLDNMDCA);
str_diffs += str_temp + _T(", ");
}
if (otherItem.GetEmail() != curItem.GetEmail()) {
示例6: CompareEntries
bool CCompareResultsDlg::CompareEntries(st_CompareData *pst_data)
{
CItemData::FieldBits bsConflicts;
bsConflicts.reset();
ItemListIter iter;
iter = m_pcore0->Find(pst_data->uuid0);
CItemData currentItem = iter->second;
iter = m_pcore1->Find(pst_data->uuid1);
CItemData compItem = iter->second;
StringX sxCurrentPassword, sxComparisonPassword;
if (currentItem.GetEntryType() == CItemData::ET_ALIAS ||
currentItem.GetEntryType() == CItemData::ET_SHORTCUT) {
CItemData *pci_base = m_pcore0->GetBaseEntry(¤tItem);
sxCurrentPassword == pci_base->GetPassword();
} else
sxCurrentPassword == currentItem.GetPassword();
if (compItem.GetEntryType() == CItemData::ET_ALIAS ||
compItem.GetEntryType() == CItemData::ET_SHORTCUT) {
CItemData *pci_base = m_pcore1->GetBaseEntry(&compItem);
sxComparisonPassword == pci_base->GetPassword();
} else
sxComparisonPassword == compItem.GetPassword();
if (m_bsFields.test(CItemData::PASSWORD) &&
sxCurrentPassword != sxComparisonPassword)
bsConflicts.flip(CItemData::PASSWORD);
if (m_bsFields.test(CItemData::NOTES) &&
FieldsNotEqual(currentItem.GetNotes(), compItem.GetNotes(), m_bTreatWhiteSpaceasEmpty))
bsConflicts.flip(CItemData::NOTES);
if (m_bsFields.test(CItemData::CTIME) &&
currentItem.GetCTime() != compItem.GetCTime())
bsConflicts.flip(CItemData::CTIME);
if (m_bsFields.test(CItemData::PMTIME) &&
currentItem.GetPMTime() != compItem.GetPMTime())
bsConflicts.flip(CItemData::PMTIME);
if (m_bsFields.test(CItemData::ATIME) &&
currentItem.GetATime() != compItem.GetATime())
bsConflicts.flip(CItemData::ATIME);
if (m_bsFields.test(CItemData::XTIME) &&
currentItem.GetXTime() != compItem.GetXTime())
bsConflicts.flip(CItemData::XTIME);
if (m_bsFields.test(CItemData::RMTIME) &&
currentItem.GetRMTime() != compItem.GetRMTime())
bsConflicts.flip(CItemData::RMTIME);
if (m_bsFields.test(CItemData::XTIME_INT)) {
int current_xint, comp_xint;
currentItem.GetXTimeInt(current_xint);
compItem.GetXTimeInt(comp_xint);
if (current_xint != comp_xint)
bsConflicts.flip(CItemData::XTIME_INT);
}
if (m_bsFields.test(CItemData::URL) &&
FieldsNotEqual(currentItem.GetURL(), compItem.GetURL(),
m_bTreatWhiteSpaceasEmpty))
bsConflicts.flip(CItemData::URL);
if (m_bsFields.test(CItemData::AUTOTYPE) &&
FieldsNotEqual(currentItem.GetAutoType(), compItem.GetAutoType(),
m_bTreatWhiteSpaceasEmpty))
bsConflicts.flip(CItemData::AUTOTYPE);
if (m_bsFields.test(CItemData::PWHIST) &&
currentItem.GetPWHistory() != compItem.GetPWHistory())
bsConflicts.flip(CItemData::PWHIST);
if (m_bsFields.test(CItemData::POLICY) &&
currentItem.GetPWPolicy() != compItem.GetPWPolicy())
bsConflicts.flip(CItemData::POLICY);
if (m_bsFields.test(CItemData::POLICYNAME) &&
currentItem.GetPolicyName() != compItem.GetPolicyName())
bsConflicts.flip(CItemData::POLICYNAME);
if (m_bsFields.test(CItemData::RUNCMD) &&
currentItem.GetRunCommand() != compItem.GetRunCommand())
bsConflicts.flip(CItemData::RUNCMD);
if (m_bsFields.test(CItemData::DCA) &&
currentItem.GetDCA() != compItem.GetDCA())
bsConflicts.flip(CItemData::DCA);
if (m_bsFields.test(CItemData::SHIFTDCA) &&
currentItem.GetShiftDCA() != compItem.GetShiftDCA())
bsConflicts.flip(CItemData::SHIFTDCA);
if (m_bsFields.test(CItemData::EMAIL) &&
currentItem.GetEmail() != compItem.GetEmail())
bsConflicts.flip(CItemData::EMAIL);
if (m_bsFields.test(CItemData::PROTECTED) &&
currentItem.GetProtected() != compItem.GetProtected())
bsConflicts.flip(CItemData::PROTECTED);
if (m_bsFields.test(CItemData::SYMBOLS) &&
currentItem.GetSymbols() != compItem.GetSymbols())
bsConflicts.flip(CItemData::SYMBOLS);
if (m_bsFields.test(CItemData::KBSHORTCUT) &&
currentItem.GetKBShortcut() != compItem.GetKBShortcut())
bsConflicts.flip(CItemData::KBSHORTCUT);
return bsConflicts.none();
}