本文整理汇总了C++中Doc::metaCommandsUsed方法的典型用法代码示例。如果您正苦于以下问题:C++ Doc::metaCommandsUsed方法的具体用法?C++ Doc::metaCommandsUsed怎么用?C++ Doc::metaCommandsUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doc
的用法示例。
在下文中一共展示了Doc::metaCommandsUsed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setQuickDoc
void QsCodeParser::setQuickDoc(Node *quickNode,
const Doc& doc,
const QStringList& qtParams,
const QStringList& quickParams)
{
QRegExp quickifyCommand("\\\\" + COMMAND_QUICKIFY + "([^\n]*)(?:\n|$)");
if (quickNode->type() == Node::Function) {
FunctionNode *quickFunc = (FunctionNode *) quickNode;
quickFunc->setOverload(false);
}
if (doc.metaCommandsUsed().contains(COMMAND_QUICKIFY)) {
QString source = doc.source();
int pos = source.indexOf(quickifyCommand);
if (pos != -1) {
QString quickifiedSource = quickNode->doc().source();
if (!qtParams.isEmpty() && qtParams != quickParams)
renameParameters(quickifiedSource, doc, qtParams,
quickParams);
applyReplacementList(quickifiedSource, doc);
do {
QString extract = quickifiedSource;
QString arg = quickifyCommand.cap(1).simplified();
if (!arg.isEmpty()) {
if (arg.startsWith("/") && arg.endsWith("/") &&
arg.length() > 2) {
QString pattern = arg.mid(1, arg.length() - 2);
extractRegExp(QRegExp(pattern), extract, doc);
}
else {
extractTarget(arg, extract, doc);
}
}
source.replace(pos, quickifyCommand.matchedLength(), extract);
pos += extract.length();
} while ((pos = source.indexOf(quickifyCommand, pos)) != -1);
QRegExp quickcodeRegExp(
"\\\\" + COMMAND_QUICKCODE + "(.*)\\\\" +
COMMAND_ENDQUICKCODE);
quickcodeRegExp.setMinimal(true);
source.replace(quickcodeRegExp, "");
}
Doc quickDoc(doc.location(),
doc.location(),
source,
(CppCodeParser::topicCommands() + topicCommands() +
CppCodeParser::otherMetaCommands()) << COMMAND_REPLACE);
quickNode->setDoc(quickDoc, true);
processOtherMetaCommands(quickDoc, quickNode);
}
else {
quickNode->setDoc(doc, true);
processOtherMetaCommands(doc, quickNode);
}
}