本文整理汇总了C++中UmlItem::properties方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlItem::properties方法的具体用法?C++ UmlItem::properties怎么用?C++ UmlItem::properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlItem
的用法示例。
在下文中一共展示了UmlItem::properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_stereotyped
void UmlItem::write_stereotyped(FileOut & out)
{
QMap<QString, Q3PtrList<UmlItem> >::Iterator it;
for (it = _stereotypes.begin(); it != _stereotypes.end(); ++it) {
const char * st = it.key();
UmlClass * cl = UmlClass::findStereotype(it.key(), TRUE);
if (cl != 0) {
Q3ValueList<WrapperStr> extended;
cl->get_extended(extended);
Q3PtrList<UmlItem> & l = it.data();
UmlItem * elt;
for (elt = l.first(); elt != 0; elt = l.next()) {
out << "\t<" << st;
out.id_prefix(elt, "STELT_");
const Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> itp(props);
while (itp.current()) {
QString k = itp.currentKey();
if (k.contains(':') == 2) {
out << " ";
out.quote((const char *)k.mid(k.findRev(':') + 1)); //[jasa] ambiguous call
out << "=\"";
out.quote((const char *)*itp.current());
out << '"';
}
++itp;
}
Q3ValueList<WrapperStr>::Iterator iter_extended;
for (iter_extended = extended.begin();
iter_extended != extended.end();
++iter_extended) {
WrapperStr vr = "base_" + *iter_extended;
out.ref(elt, vr);
}
out << "/>\n";
elt->unload();
}
}
}
}
示例2: applyStereotype
void UmlPackage::applyStereotype(FileIn & in, Token & token)
{
WrapperStr prof_st;
Q3ValueList<WrapperStr> base_v;
WrapperStr s;
if (UmlClass::isAppliedStereotype(token, prof_st, base_v)) {
WrapperStr s;
Q3ValueList<WrapperStr>::Iterator it_ext;
for (it_ext = base_v.begin(); it_ext != base_v.end(); ++it_ext) {
WrapperStr s2;
if (token.valueOf(*it_ext, s2)) {
if (s.isEmpty())
s = s2;
else if (s != s2)
in.warning("doesn't refer to the same element ('" + s + "' != '" + s2 + "')");
}
}
if (s.isEmpty())
in.warning("value of 'base_...' is missing");
else {
UmlItem * elt = All[s];
if (elt == 0) {
if (!FileIn::isBypassedId(s))
in.warning("unknown reference '" + s + "'");
}
else {
elt->set_Stereotype(prof_st);
elt->UmlItem::applyStereotype(); // set properties
Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> it(props);
while (it.current()) {
WrapperStr k = it.currentKey().latin1();
if (token.valueOf(k.mid(k.findRev(':') + 1).lower(), s))
elt->set_PropertyValue(k, s);
++it;
}
}
}
if (! token.closed())
in.finish(token.what());
}
else
in.bypass(token);
}