本文整理汇总了C++中CSmartPtr::HandleTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CSmartPtr::HandleTag方法的具体用法?C++ CSmartPtr::HandleTag怎么用?C++ CSmartPtr::HandleTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSmartPtr
的用法示例。
在下文中一共展示了CSmartPtr::HandleTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Print
//.........这里部分代码省略.........
// We are at the end of the loop so we need to inc the index
CTemplateLoopContext* pContext = GetCurLoopContext();
if (pContext) {
pContext->IncRowIndex();
// If we didn't go out of bounds we need to seek back to the top of our loop
if (!bLoopBreak && pContext->GetCurRow()) {
uCurPos = pContext->GetFilePosition();
uFilePos = uCurPos;
uLineSize = 0;
File.Seek(uCurPos);
bBroke = true;
if (!sOutput.Trim_n().empty()) {
pContext->SetHasData();
}
break;
} else {
if (sOutput.Trim_n().empty()) {
sOutput.clear();
}
bTmplLoopHasData = pContext->HasData();
DelCurLoopContext();
bLoopBreak = false;
}
}
}
} else if (sAction.Equals("ELSE")) {
if (!bValidLastIf && uSkip == 1) {
CString sArg = sArgs.Token(0);
if (sArg.empty() || (sArg.Equals("IF") && ValidIf(sArgs.Token(1, true)))) {
uSkip = 0;
bValidLastIf = true;
}
} else if (!uSkip) {
uSkip = 1;
}
} else if (bNotFound) {
// Unknown tag that isn't being skipped...
vector<CSmartPtr<CTemplateTagHandler> >& vspTagHandlers = GetTagHandlers();
if (!vspTagHandlers.empty()) { // @todo this should go up to the top to grab handlers
CTemplate* pTmpl = GetCurTemplate();
CString sCustomOutput;
for (unsigned int j = 0; j < vspTagHandlers.size(); j++) {
CSmartPtr<CTemplateTagHandler> spTagHandler = vspTagHandlers[j];
if (spTagHandler->HandleTag(*pTmpl, sAction, sArgs, sCustomOutput)) {
sOutput += sCustomOutput;
bNotFound = false;
break;
}
}
if (bNotFound) {
DEBUG("Unknown/Unhandled tag [" + sAction + "]");
}
}
}
continue;
}
DEBUG("Malformed tag on line " + CString(uLineNum) + " of [" << File.GetLongName() + "]");
DEBUG("--------------- [" + sLine + "]");
}
if (!bBroke) {
uFilePos += uLineSize;
if (!uSkip) {
sOutput += sLine;
}
}
if (!bFoundATag || bTmplLoopHasData || sOutput.find_first_not_of(" \t\r\n") != CString::npos) {
if (bInSetBlock) {
CString sName = sSetBlockVar.Token(0);
//CString sValue = sSetBlockVar.Token(1, true);
(*this)[sName] += sOutput;
} else {
oOut << sOutput;
}
}
if (bExit) {
break;
}
}
oOut.flush();
return true;
}