本文整理汇总了C++中UmlRelation::phpDecl方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlRelation::phpDecl方法的具体用法?C++ UmlRelation::phpDecl怎么用?C++ UmlRelation::phpDecl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlRelation
的用法示例。
在下文中一共展示了UmlRelation::phpDecl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gen_php_decl
void UmlClass::gen_php_decl(QCString s, bool descr) {
QCString st = PhpSettings::classStereotype(stereotype());
if (st == "ignored")
return;
const char * p = bypass_comment(s);
UmlRelation * extend = 0;
while (*p != 0) {
if (!strncmp(p, "${comment}", 10))
p += 10;
else if (!strncmp(p, "${description}", 14))
p += 14;
else if (!strncmp(p, "${visibility}", 13)) {
p += 13;
UmlItem::write(visibility(), phpLanguage);
fw.write(' ');
}
else if (!strncmp(p, "${final}", 8)) {
p += 8;
if (isPhpFinal())
fw.write("final ");
}
else if (!strncmp(p, "${abstract}", 11)) {
p += 11;
if (isAbstract())
fw.write("abstract ");
}
else if (!strncmp(p, "${name}", 7)) {
p += 7;
writeq(name());
generics();
}
else if (!strncmp(p, "${extends}", 10)) {
p += 10;
const QVector<UmlItem> ch = children();
for (unsigned i = 0; i != ch.size(); i += 1) {
if (ch[i]->kind() == aRelation) {
UmlRelation * rel = (UmlRelation *) ch[i];
aRelationKind k = rel->relationKind();
if (((k == aGeneralisation) ||
(k == aRealization)) &&
(!rel->phpDecl().isEmpty()) &&
((st == "interface") ||
(PhpSettings::classStereotype(rel->roleType()->stereotype()) != "interface"))) {
extend = rel;
fw.write(" extends ");
rel->roleType()->write();
break;
}
}
}
}
else if (!strncmp(p, "${implements}", 13)) {
p += 13;
const QVector<UmlItem> ch = children();
const char * sep = " implements ";
for (unsigned i = 0; i != ch.size(); i += 1) {
if (ch[i]->kind() == aRelation) {
UmlRelation * rel = (UmlRelation *) ch[i];
aRelationKind k = rel->relationKind();
if ((rel != extend) &&
((k == aGeneralisation) ||
(k == aRealization)) &&
(!rel->phpDecl().isEmpty())) {
fw.write(sep);
sep = ", ";
rel->roleType()->write();
}
}
}
}
else if (*p == '\r')
p += 1;
else if (*p == '\n') {
if (descr) {
fw.write("<br />");
p += 1;
}
else {
fw.write(' ');
do
p += 1;
while ((*p != 0) && (*p <= ' '));
}
}
else if ((*p == '{') || (*p == ';')) {
if (descr)
fw.write(*p++);
else
break;
}
//.........这里部分代码省略.........