本文整理汇总了C++中CDocument::SetTopicsTree方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocument::SetTopicsTree方法的具体用法?C++ CDocument::SetTopicsTree怎么用?C++ CDocument::SetTopicsTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDocument
的用法示例。
在下文中一共展示了CDocument::SetTopicsTree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MergeTopicsTree
void CHelpSystemCore::MergeTopicsTree(
CChm &chmRef, chmTopicsTreeIter chmBegin, chmTopicsTreeIter chmEnd,
CTopicsTree * parent, CTopicsTree::CHILDREN &topicsTree
)
{
for (; chmBegin != chmEnd; ++chmBegin)
{
const std::string *nodeTitle = &(*chmBegin)->title;
CTopicsTree::CHILDREN::iterator node;
// Search for node with same name.
for (node = topicsTree.begin(); node != topicsTree.end(); ++node)
{
if (node->GetTitle() == *nodeTitle)
{
break;
}
}
if (node == topicsTree.end())
{
topicsTree.push_back(CTopicsTree(parent, nodeTitle, NULL));
node = topicsTree.end();
--node;
}
if (!(*chmBegin)->path.empty())
{
if (node->GetDocument())
{
// TODO: Error! Can't merge nodes with non-empty topic.
}
else
{
CDocument * doc = chmRef.GetDocument(&(*chmBegin)->path);
doc->SetTopicsTree(&(*node));
node->SetDocument(doc);
}
}
if (!(*chmBegin)->children.empty())
{
MergeTopicsTree(
chmRef, (*chmBegin)->children.begin(), (*chmBegin)->children.end(),
&(*node), node->GetChildren()
);
}
}
}