本文整理汇总了C++中CBookmarkFolder::InsertBookmarkFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ CBookmarkFolder::InsertBookmarkFolder方法的具体用法?C++ CBookmarkFolder::InsertBookmarkFolder怎么用?C++ CBookmarkFolder::InsertBookmarkFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBookmarkFolder
的用法示例。
在下文中一共展示了CBookmarkFolder::InsertBookmarkFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BookmarkItemAdded
void CIPBookmarkObserver::BookmarkItemAdded(void *pData,bool bFolder)
{
IPBookmarkAddedNotification_t *pipban = reinterpret_cast<IPBookmarkAddedNotification_t *>(pData);
/* TODO: Find the parent with the specified GUID. */
//pipban->guidParent
CBookmarkFolder *pParentBookmarkFolder = m_pAllBookmarks;
m_pipbns->SetIPBroadcast(false);
char *pSerializedData = reinterpret_cast<char *>(pData) + sizeof(IPBookmarkAddedNotification_t);
try
{
if(bFolder)
{
CBookmarkFolder BookmarkFolder = CBookmarkFolder::Unserialize(pSerializedData);
pParentBookmarkFolder->InsertBookmarkFolder(BookmarkFolder,pipban->uPosition);
}
else
{
CBookmark Bookmark(pSerializedData);
pParentBookmarkFolder->InsertBookmark(Bookmark,pipban->uPosition);
}
}
catch(int)
{
/* The actual content of the error here
is unimportant. May be needed in the
future if an error message will be shown
to the user. */
}
m_pipbns->SetIPBroadcast(true);
}
示例2:
TEST(BookmarkTest,BookmarkFolderChild)
{
CBookmarkFolder BookmarkFolderParent = CBookmarkFolder::Create(L"Test");
CBookmarkFolder BookmarkFolder = CBookmarkFolder::Create(L"Test name");
BookmarkFolderParent.InsertBookmarkFolder(BookmarkFolder);
ASSERT_EQ(true,BookmarkFolderParent.HasChildFolder());
auto itr = BookmarkFolderParent.begin();
CBookmarkFolder ChildBookmarkFolder = boost::get<CBookmarkFolder>(*itr);
EXPECT_EQ(BookmarkFolder.GetName(),ChildBookmarkFolder.GetName());
}