本文整理汇总了C++中CItemData::HasAttRef方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::HasAttRef方法的具体用法?C++ CItemData::HasAttRef怎么用?C++ CItemData::HasAttRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemData
的用法示例。
在下文中一共展示了CItemData::HasAttRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: passkey
TEST_F(FileV4Test, CoreRWTest)
{
PWScore core;
const StringX passkey(L"3rdMambo");
fullItem.SetAttUUID(attItem.GetUUID());
EXPECT_EQ(0U, attItem.GetRefcount());
core.SetPassKey(passkey);
core.Execute(AddEntryCommand::Create(&core, fullItem, pws_os::CUUID::NullUUID(), &attItem));
EXPECT_TRUE(core.HasAtt(attItem.GetUUID()));
EXPECT_EQ(1U, core.GetAtt(attItem.GetUUID()).GetRefcount());
EXPECT_EQ(PWSfile::SUCCESS, core.WriteFile(fname.c_str(), PWSfile::V40));
core.ClearDBData();
EXPECT_EQ(PWSfile::FAILURE, core.ReadFile(fname.c_str(), L"WrongPassword", true));
EXPECT_EQ(PWSfile::SUCCESS, core.ReadFile(fname.c_str(), passkey, true));
ASSERT_EQ(1, core.GetNumEntries());
ASSERT_EQ(1, core.GetNumAtts());
ASSERT_TRUE(core.Find(fullItem.GetUUID()) != core.GetEntryEndIter());
const CItemData readFullItem = core.GetEntry(core.Find(fullItem.GetUUID()));
EXPECT_TRUE(readFullItem.HasAttRef());
EXPECT_EQ(attItem.GetUUID(), readFullItem.GetAttUUID());
EXPECT_EQ(fullItem, readFullItem);
ASSERT_TRUE(core.HasAtt(attItem.GetUUID()));
EXPECT_EQ(1U, core.GetAtt(attItem.GetUUID()).GetRefcount());
core.Execute(DeleteEntryCommand::Create(&core, readFullItem));
ASSERT_EQ(0, core.GetNumEntries());
ASSERT_EQ(0, core.GetNumAtts());
// Get core to delete any existing commands
core.ClearCommands();
}
示例2: MakeTreeDisplayString
CSecString CCWTreeCtrl::MakeTreeDisplayString(const CItemData &ci) const
{
CSecString treeDispString = ci.GetTitle();
treeDispString += L" [";
treeDispString += ci.GetUser();
treeDispString += L"]";
if (ci.IsProtected())
treeDispString += L" #";
if (ci.HasAttRef())
treeDispString += L" +";
return treeDispString;
}