本文整理汇总了C++中UmlOperation::is_useless方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlOperation::is_useless方法的具体用法?C++ UmlOperation::is_useless怎么用?C++ UmlOperation::is_useless使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlOperation
的用法示例。
在下文中一共展示了UmlOperation::is_useless方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strtol
UmlOperation * UmlOperation::already_exist_from_id(Class * container, Q3CString & body)
{
const char * BodyPrefix = "// Bouml preserved body begin ";
const char * BodyPostfix = "// Bouml preserved body end ";
const int BodyPrefixLength = 30;
const int BodyPostfixLength = 28;
int index = body.find(BodyPrefix);
if (index != -1) {
const char * b1 = ((const char *) body) + index + BodyPrefixLength;
char * b2;
long id = strtol(b1, &b2, 16);
if (b2 != (b1 + 8)) {
QString err = "<font color =\"red\"> Error in " + Lex::filename() +
" before line " + QString::number(Lex::line_number()) +
" : invalid preserve body identifier</font><br>";
UmlCom::trace(err);
throw 0;
}
if (*b2 == '\r')
b2 += 1;
if (*b2 == '\n')
b2 += 1;
else {
QString err = "<font color =\"red\"> Error in " + Lex::filename() +
" before line " + QString::number(Lex::line_number()) +
" : invalid preserve body block, end of line expected</font><br>";
UmlCom::trace(err);
throw 0;
}
const char * e;
if (((e = strstr(b2, BodyPostfix)) == 0) ||
(strncmp(e + BodyPostfixLength, b1, 8) != 0)) {
QString err = "<font color =\"red\"> Error in " + Lex::filename() +
" before line " + QString::number(Lex::line_number()) +
" : invalid preserve body block, wrong balanced</font><br>";
UmlCom::trace(err);
throw 0;
}
while ((e != b2) && (e[-1] != '\n'))
e -= 1;
body = body.mid(b2 - (const char *) body, e - b2);
UmlOperation * op = (UmlOperation *) UmlBaseItem::from_id((unsigned) id, anOperation);
if (op != 0) {
if (!op->is_useless()) {
QString err = "<font color =\"red\"> Error in " + Lex::filename() +
" before line " + QString::number(Lex::line_number()) +
" : preserve body block identifier used twice</font><br>";
UmlCom::trace(err);
throw 0;
}
if ((op->parent() == container->get_uml()) &&
// currently get/set are removed then recreated
(op->getOf() == 0) &&
(op->setOf() == 0))
return op;
}
}
return 0;
}