本文整理汇总了C++中UmlRelation::roleName方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::roleName方法的具体用法?C++ UmlRelation::roleName怎么用?C++ UmlRelation::roleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlRelation
的用法示例。
在下文中一共展示了UmlRelation::roleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate
void UmlRelation::generate(QTextStream & f, const Q3CString &,
Q3CString indent, int &) {
switch (relationKind()) {
case aDependency:
case aGeneralisation:
case aRealization:
break;
default:
if (!phpDecl().isEmpty()) {
const char * p = phpDecl();
const char * pp = 0;
Q3CString s;
while ((*p == ' ') || (*p == '\t'))
indent += *p++;
f << indent;
for (;;) {
if (*p == 0) {
if (pp == 0)
break;
// comment management done
p = pp;
pp = 0;
if (*p == 0)
break;
f << indent;
}
if (*p == '\n') {
f << *p++;
if (*p)
f << indent;
}
else if (*p == '@')
manage_alias(p, f);
else if (*p != '$')
f << *p++;
else if (!strncmp(p, "${comment}", 10))
manage_comment(p, pp, PhpSettings::isGenerateJavadocStyleComment());
else if (!strncmp(p, "${description}", 14))
manage_description(p, pp);
else if (!strncmp(p, "${visibility}", 13)) {
p += 13;
generate_visibility(f);
}
else if (!strncmp(p, "${static}", 9)) {
p += 9;
if (isClassMember())
f << "static ";
}
else if (!strncmp(p, "${type}", 7)) {
p += 7;
roleType()->write(f);
}
else if (!strncmp(p, "${name}", 7)) {
p += 7;
if (!isReadOnly())
f << "$";
f << roleName();
}
else if (!strncmp(p, "${inverse_name}", 15)) {
p += 15;
switch (relationKind()) {
case anAssociation:
case anAggregation:
case anAggregationByValue:
{
UmlRelation * inverse = side(side(TRUE) != this);
if (!inverse->isReadOnly())
f << "$";
f << inverse->roleName();
}
default:
break;
}
}
else if (!strncmp(p, "${var}", 6)) {
p += 6;
if (!isReadOnly() &&
!isClassMember() &&
(visibility() == PackageVisibility))
f << "var ";
}
else if (!strncmp(p, "${value}", 8)) {
if (!defaultValue().isEmpty()) {
if (need_equal(p, defaultValue()))
f << " = ";
f << defaultValue();
}
p += 8;
}
else if (!strncmp(p, "${const}", 8)) {
p += 8;
if (isReadOnly())
f << "const ";
}
//.........这里部分代码省略.........