本文整理汇总了C++中UmlOperation::isBodyGenerationForced方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlOperation::isBodyGenerationForced方法的具体用法?C++ UmlOperation::isBodyGenerationForced怎么用?C++ UmlOperation::isBodyGenerationForced使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlOperation
的用法示例。
在下文中一共展示了UmlOperation::isBodyGenerationForced方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: roundtrip
//.........这里部分代码省略.........
default:
// python
get_body = &UmlOperation::pythonBody;
set_body = &UmlOperation::set_PythonBody;
set_contextualbodyindent = &UmlOperation::set_PythonContextualBodyIndent;
prefix = BodyPythonPrefix;
postfix = BodyPythonPostfix;
}
while ((p2 = strstr(p1, prefix)) != 0) {
p2 += BodyPrefixLength;
char * body;
long id = strtol(p2, &body, 16);
if (body != (p2 + 8)) {
UmlCom::trace(WrapperStr("<font color =\"red\"> Error in ") + path +
linenumber(s, p2 - BodyPrefixLength) +
" : invalid preserve body identifier</font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("read_bodies 1");
}
if (*body == '\r')
body += 1;
if (*body == '\n')
body += 1;
else {
UmlCom::trace(WrapperStr("<font color =\"red\"> Error in ") + path +
linenumber(s, p2 - BodyPrefixLength) +
" : invalid preserve body block, end of line expected</font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("read_bodies 2");
}
UmlOperation * op = (UmlOperation *)
UmlBaseItem::from_id((unsigned) id, anOperation);
if (op == 0) {
QString n("%1");
n.arg(QString::number((unsigned) id));
UmlCom::trace(WrapperStr("<font color =\"red\"> Error in ") + path +
linenumber(s, p2 - BodyPrefixLength) +
" : invalid operation id " + n + "</font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("read_bodies 3");
return;
}
if (((p1 = strstr(body, postfix)) == 0) ||
(strncmp(p1 + BodyPostfixLength, p2, 8) != 0)) {
UmlCom::trace(WrapperStr("<font color =\"red\"> Error in ") + path +
linenumber(s, p2 - BodyPrefixLength) +
" : invalid preserve body block, wrong balanced</font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("read_bodies 4");
}
p2 = p1;
while ((p2 != body) && (p2[-1] != '\n'))
p2 -= 1;
char c = *p2;
*p2 = 0;
WrapperStr previous = (op->*get_body)();
if (!op->isBodyGenerationForced() && (body != previous)) {
if (!(op->*set_body)(body)) {
write_trace_header();
UmlCom::trace(" <font color=\"red\"><b>cannot update body of <i>"
+ op->name() +
((op->isWritable()) ? "</i>, it is probably deleted</b></font><br>"
: "</i>, it is read-only</b></font><br>"));
incr_error();
}
else {
(op->*set_contextualbodyindent)(FALSE);
write_trace_header();
UmlCom::trace(" update body of <i>"
+ op->name() + "</i><br>");
}
}
else if (verbose()) {
write_trace_header();
UmlCom::trace(" body of <i>"
+ op->name() + "</i> unchanged<br>");
}
*p2 = c;
p1 += BodyPostfixLength + 8;
}
delete [] s;
}
}