本文整理汇总了C++中TagStack::pop方法的典型用法代码示例。如果您正苦于以下问题:C++ TagStack::pop方法的具体用法?C++ TagStack::pop怎么用?C++ TagStack::pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagStack
的用法示例。
在下文中一共展示了TagStack::pop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tag_end
void RTFGenParser::tag_end(const QString &tagName)
{
// Roll back until we find our tag.
bool found = false;
for(Tag* pTag = m_tags.peek(); pTag != NULL && !found; pTag = m_tags.peek())
{
if (pTag->name == tagName)
{
found = true;
}
if (pTag->hasCharStyle())
{
CharStyle style = *(pTag->pCharStyle);
// We must pop here, so that getTopTagWithCharStyle will find a parent tag.
m_tags.pop();
pTag = NULL; // to avoid confusion
Tag* pParentTag = m_tags.getTopTagWithCharStyle();
if (pParentTag != NULL)
{
if (pParentTag->hasCharStyle())
{
CharStyle* pParentStyle = pParentTag->pCharStyle;
// Roll back the character style. This is regardless of whether
// we found the closed tag; we just collapse all styles on our way.
QString rtf = pParentStyle->getDiffRTF(style);
if (!rtf.isEmpty())
{
res += rtf.utf8();
m_bSpace = true;
}
}
}
}
else // if this tag has no char style attached
{
m_tags.pop(); // just pop the tag out
pTag = NULL; // to avoid confusion
}
if (found)
{
if (tagName.lower() == "p")
{
res += "\\par";
m_bSpace = true;
}
}
}
}