当前位置: 首页>>代码示例>>C++>>正文


C++ CItemData::GetFieldValue方法代码示例

本文整理汇总了C++中CItemData::GetFieldValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::GetFieldValue方法的具体用法?C++ CItemData::GetFieldValue怎么用?C++ CItemData::GetFieldValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CItemData的用法示例。


在下文中一共展示了CItemData::GetFieldValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsEnabled

bool PWSDragBar::IsEnabled(int id) const
{
  const int idx = id - DRAGBAR_TOOLID_BASE;
  wxASSERT( idx >= 0 && size_t(idx) < NumberOf(DragbarElements));
  
  CItemData* item = m_frame->GetSelectedEntry();
  return item != 0 && item->GetFieldValue(DragbarElements[idx].ft).empty() == false;
}
开发者ID:NonPlayerCharactor,项目名称:PasswordSafeFork,代码行数:8,代码来源:PWSDragBar.cpp

示例2: GetText

wxString PWSDragBar::GetText(int id) const
{
  CItemData* item = m_frame->GetSelectedEntry();
  if (item) {
    return towxstring(item->GetFieldValue(DragbarElements[id-DRAGBAR_TOOLID_BASE].ft));
  }
  return wxEmptyString;
}
开发者ID:NonPlayerCharactor,项目名称:PasswordSafeFork,代码行数:8,代码来源:PWSDragBar.cpp

示例3: CompareField

static void CompareField(CItemData::FieldType field,
                         const CItemData::FieldBits &bsTest,
                         const CItemData &first, const CItemData &second,
                         CItemData::FieldBits &bsConflicts, bool bTreatWhiteSpaceasEmpty = false)
{
  if (bsTest.test(field)) {
    bool flip;
    if (bTreatWhiteSpaceasEmpty) {
      StringX a(first.GetFieldValue(field)), b(second.GetFieldValue(field));
      EmptyIfOnlyWhiteSpace(a); EmptyIfOnlyWhiteSpace(b);
      flip = a != b;
    } else {
      flip = first.GetFieldValue(field) != second.GetFieldValue(field);
    }
    if (flip)
      bsConflicts.flip(field);
  }
}
开发者ID:NonPlayerCharactor,项目名称:PasswordSafeFork,代码行数:18,代码来源:CoreOtherDB.cpp

示例4: Command

UpdateEntryCommand::UpdateEntryCommand(CommandInterface *pcomInt,
                                       const CItemData &ci,
                                       CItemData::FieldType ftype,
                                       const StringX &value)
  : Command(pcomInt), m_ftype(ftype), m_value(value)
{
  m_entry_uuid = ci.GetUUID();
  m_old_status = ci.GetStatus();
  m_old_value = ci.GetFieldValue(m_ftype);
}
开发者ID:bwilcox,项目名称:pwsafe,代码行数:10,代码来源:Command.cpp

示例5: context_tag

/////////////////////////////////////////////////////////////////
// Context diff
////////
inline wchar_t context_tag(CItem::FieldType ft, const CItemData::FieldBits &fields,
                const CItemData &item, const CItemData &otherItem)
{
  // The two items were compared & found to be differing on this field
  // only show this tag for fields there were compared
  if (fields.test(ft))
    return '!';

  const StringX val{item.GetFieldValue(ft)};

  // This field was not compared, it could be different. Print it only if
  // it is the same in both items
  if (val == otherItem.GetFieldValue(ft))
    return L' ';

  if (val.empty())
    return L'+';

  // Don't print it
  return L'-';
}
开发者ID:soundsrc,项目名称:pwsafe,代码行数:24,代码来源:diff.cpp

示例6: Synchronize

void PWScore::Synchronize(PWScore *pothercore,
                          const CItemData::FieldBits &bsFields, const bool &subgroup_bset,
                          const stringT &subgroup_name,
                          const int &subgroup_object, const int &subgroup_function,
                          int &numUpdated, CReport *pRpt, bool *pbCancel)
{
  /*
  Purpose:
    Synchronize entries from otherCore to m_core

  Algorithm:
    Foreach entry in otherCore
      Find in m_core
        if find a match
          update requested fields
  */

  std::vector<StringX> vs_updated;
  numUpdated = 0;

  MultiCommands *pmulticmds = MultiCommands::Create(this);
  Command *pcmd1 = UpdateGUICommand::Create(this, UpdateGUICommand::WN_UNDO,
                                            UpdateGUICommand::GUI_UNDO_MERGESYNC);
  pmulticmds->Add(pcmd1);

  // Make sure we don't add it multiple times
  std::map<StringX, StringX> mapRenamedPolicies;
  std::vector<StringX> vs_PoliciesAdded;
  const StringX sxSync_DateTime = PWSUtil::GetTimeStamp(true).c_str();

  ItemListConstIter otherPos;
  for (otherPos = pothercore->GetEntryIter();
       otherPos != pothercore->GetEntryEndIter();
       otherPos++) {
    // See if user has cancelled
    if (pbCancel != NULL && *pbCancel) {
      delete pmulticmds;
      return;
    }

    CItemData otherItem = pothercore->GetEntry(otherPos);
    CItemData::EntryType et = otherItem.GetEntryType();

    // Do not process Aliases and Shortcuts
    if (et == CItemData::ET_ALIAS || et == CItemData::ET_SHORTCUT)
      continue;

    if (subgroup_bset &&
        !otherItem.Matches(subgroup_name, subgroup_object, subgroup_function))
      continue;

    const StringX sx_otherGroup = otherItem.GetGroup();
    const StringX sx_otherTitle = otherItem.GetTitle();
    const StringX sx_otherUser = otherItem.GetUser();

    StringX sx_mergedentry;
    Format(sx_mergedentry, GROUPTITLEUSERINCHEVRONS,
                sx_otherGroup.c_str(), sx_otherTitle.c_str(), sx_otherUser.c_str());

    ItemListConstIter foundPos = Find(sx_otherGroup, sx_otherTitle, sx_otherUser);

    if (foundPos != GetEntryEndIter()) {
      // found a match
      CItemData curItem = GetEntry(foundPos);

      // Don't update if entry is protected
      if (curItem.IsProtected())
        continue;

      CItemData updItem(curItem);
      updItem.SetDisplayInfo(NULL);

      if (curItem.GetUUID() != otherItem.GetUUID()) {
        pws_os::Trace(_T("Synchronize: Mis-match UUIDs for [%ls:%ls:%ls]\n"),
             sx_otherGroup.c_str(), sx_otherTitle.c_str(), sx_otherUser.c_str());
      }

      bool bUpdated(false);
      // Do not try and change GROUPTITLE = 0x00 (use GROUP & TITLE separately) or UUID = 0x01
      for (size_t i = 2; i < bsFields.size(); i++) {
        if (bsFields.test(i)) {
          StringX sxValue = otherItem.GetFieldValue(static_cast<CItemData::FieldType>(i));

          // Special processing for password policies (default & named)
          if (static_cast<CItemData::FieldType>(i) == CItemData::POLICYNAME) {
            Command *pPolicyCmd = ProcessPolicyName(pothercore, updItem,
                                   mapRenamedPolicies, vs_PoliciesAdded,
                                   sxValue, bUpdated,
                                   sxSync_DateTime, IDSC_SYNCPOLICY);
            if (pPolicyCmd != NULL)
              pmulticmds->Add(pPolicyCmd);
          } else {
            if (sxValue != updItem.GetFieldValue(static_cast<CItemData::FieldType>(i))) {
              bUpdated = true;
              updItem.SetFieldValue(static_cast<CItemData::FieldType>(i), sxValue);
            }
          }
        }
      }

//.........这里部分代码省略.........
开发者ID:NonPlayerCharactor,项目名称:PasswordSafeFork,代码行数:101,代码来源:CoreOtherDB.cpp


注:本文中的CItemData::GetFieldValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。