本文整理汇总了C++中UmlPackage::idlModule方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlPackage::idlModule方法的具体用法?C++ UmlPackage::idlModule怎么用?C++ UmlPackage::idlModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlPackage
的用法示例。
在下文中一共展示了UmlPackage::idlModule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate
void UmlArtifact::generate() {
if (! managed) {
managed = TRUE;
if (stereotype() == "text") {
generate_text();
return;
}
else if (stereotype() != "source")
return;
package_of_generated_artifact = package();
const Q3CString def = idlSource();
if (def.isEmpty())
return;
const Q3CString & name = this->name();
UmlPackage * pack = package();
Q3CString path = pack->path(name);
Q3CString mod_start;
Q3CString mod_end;
Q3CString mod = pack->idlModule();
if (! mod.isEmpty()) {
int index = 0;
int index2;
Q3CString closed = "\n}; // module ";
while ((index2 = mod.find(':', index)) != -1) {
Q3CString mo = mod.mid(index, index2 - index);
mod_start += Q3CString("module ") + mo + " {\n\n";
closed += mo;
mod_end = closed + "\n" + mod_end;
closed += "::";
mod.replace(index2, 2, "_");
index = index2 + 1;
}
mod_start += Q3CString("module ") + mod.mid(index) + " {\n\n";
closed += mod.mid(index);
mod_end = closed + "\n" + mod_end;
}
UmlCom::message(name);
if (verbose())
UmlCom::trace(Q3CString("<hr><font face=helvetica>Generate code for <i> ")
+ name + "</i> in <i>" + path + "</i></font><br>");
else
set_trace_header(Q3CString("<font face=helvetica>Generate code for <i> ")
+ name + "</i> in <i>" + path + "</i></font><br>");
#if 0
// compute dependencies
Q3PtrList<CppRefType> dependencies;
#endif
const Q3PtrVector<UmlClass> & cls = associatedClasses();
unsigned n = cls.count();
unsigned index;
#if 0
for (index = 0; index != n; index += 1)
cls[index]->compute_dependencies(dependencies);
#endif
// generate source file
QByteArray file;
QTextOStream f(&file);
const char * p = def;
const char * pp = 0;
for (;;) {
if (*p == 0) {
if (pp == 0)
break;
// comment management done
p = pp;
pp = 0;
if (*p == 0)
break;
}
if (*p == '@')
manage_alias(p, f);
else if (*p != '$')
f << *p++;
else if (!strncmp(p, "${comment}", 10))
manage_comment(p, pp);
else if (!strncmp(p, "${description}", 14))
manage_description(p, pp);
else if (!strncmp(p, "${name}", 7)) {
p += 7;
f << name;
}
else if (!strncmp(p, "${Name}", 7)) {
//.........这里部分代码省略.........