/usr/lib/bouml/genpro/6913.bodies is in bouml-plugouts-src 4.21-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | class UmlArtifact
!!!128154.cpp!!! genpro() : void
UmlPackage * pack = (UmlPackage *) parent()->parent();
QCString path;
if (! propertyValue("genpro path", path)) {
path = pack->cppSrcDir();
if (path.isEmpty())
path = root_dir();
else if (QDir::isRelativePath(path)) {
QDir d(root_dir());
d.cd(path);
path = d.absPath();
}
}
if (stereotype() == "executable") {
gen_app(path);
}
else
UmlCom::trace(stereotype() + " : not managed");
!!!128282.cpp!!! gen_app(in path : QCString) : void
QCString target;
QCString pro;
propertyValue("genpro target", target);
propertyValue("genpro pro", pro);
if (target.isEmpty()) {
if ((target = name()) == "executable")
target = UmlPackage::getProject()->name();
#ifdef WIN32
target += ".exe";
#endif
}
if (pro.isEmpty()) {
pro = target;
#ifdef WIN32
if (pro.right(4) == ".exe")
pro.resize(pro.length() - 4);
#endif
QDir d(path);
pro = d.absFilePath(pro + ".pro");
}
QCString tmplt;
QCString config;
QCString defines;
QCString includepath;
QCString dependpath;
QCString objectsdir;
QCString footer;
if (!propertyValue("genpro tmplt", tmplt))
tmplt = "app";
if (!propertyValue("genpro config", config))
config = "debug warn_on qt";
if (!propertyValue("genpro defines", defines))
defines = "WITHCPP WITHJAVA WITHPHP WITHPYTHON WITHIDL";
else if (defines.find("WITHPHP") == -1) {
int n = 0;
if (defines.find("WITHCPP") != -1)
n += 1;
if (defines.find("WITHJAVA") != -1)
n += 1;
if (defines.find("WITHIDL") != -1)
n += 1;
if (n > 1)
defines += " WITHPHP WITHPYTHON";
}
else if (defines.find("WITHPYTHON") == -1) {
int n = 0;
if (defines.find("WITHCPP") != -1)
n += 1;
if (defines.find("WITHJAVA") != -1)
n += 1;
if (defines.find("WITHIDL") != -1)
n += 1;
if (defines.find("WITHPHP") != -1)
n += 1;
if (n > 1)
defines += " WITHPYTHON";
}
propertyValue("genpro includepath", includepath);
propertyValue("genpro dependpath", dependpath);
propertyValue("genpro objectsdir", objectsdir);
propertyValue("genpro footer", footer);
for (;;) {
Dialog dialog(this, path, pro, target, tmplt, config, defines,
includepath, dependpath, objectsdir, footer);
if (dialog.exec() != QDialog::Accepted)
return;
set_PropertyValue("genpro pro", pro);
set_PropertyValue("genpro path", path);
set_PropertyValue("genpro target", target);
set_PropertyValue("genpro tmplt", tmplt);
set_PropertyValue("genpro config", config);
set_PropertyValue("genpro defines", defines);
set_PropertyValue("genpro includepath", includepath);
set_PropertyValue("genpro dependpath", dependpath);
set_PropertyValue("genpro objectsdir", objectsdir);
set_PropertyValue("genpro footer", footer);
QFile f(pro);
if (! f.open(IO_WriteOnly))
QMessageBox::critical((QWidget *) 0, "Error", "Cannot open " + QString(pro));
else {
QTextStream t(&f);
QFileInfo tfi(target);
QFileInfo pfi(pro);
t << "TEMPLATE\t= " << tmplt << '\n';
t << "TARGET\t\t= " << tfi.fileName() << '\n';
if ((target.find('/') != -1) &&
(pro.find('/') != -1) &&
(tfi.dirPath(TRUE) != pfi.dirPath(TRUE)))
t << "DESTDIR\t\t= " << tfi.dirPath(TRUE) << '\n';
if (! objectsdir.isEmpty())
t << "OBJECTS_DIR\t= " << objectsdir << '\n';
t << "CONFIG\t\t+= " << config << '\n';
if (!includepath.isEmpty())
t << "INCLUDEPATH\t= " << includepath << '\n';
if (!dependpath.isEmpty())
t << "DEPENDPATH\t= " << dependpath << '\n';
if (!defines.isEmpty())
t << "DEFINES\t\t= " << defines << '\n';
QString prodir = pfi.dirPath(TRUE);
const QVector<UmlArtifact> & arts = associatedArtifacts();
unsigned index;
const char * sep;
QCString ext;
ext = CppSettings::headerExtension();
sep = "HEADERS\t\t= ";
for (index = 0; index != arts.count(); index += 1) {
UmlArtifact * art = arts[index];
if ((art->stereotype() == "source") && !art->cppHeader().isEmpty()) {
QString s = art->way(prodir, TRUE);
if (! s.isEmpty()) {
t << sep << s << art->name() << '.' << ext;
sep = " \\\n\t\t ";
}
}
}
t << '\n';
ext = CppSettings::sourceExtension();
sep = "SOURCES\t\t= ";
for (index = 0; index != arts.count(); index += 1) {
UmlArtifact * art = arts[index];
if ((art->stereotype() != "source") || !art->cppSource().isEmpty()) {
QString s = art->way(prodir, FALSE);
if (! s.isEmpty()) {
t << sep << s << art->name();
if (art->stereotype() == "source")
t << '.' << ext;
sep = " \\\n\t\t ";
}
}
}
t << '\n' << footer << '\n';
f.close();
return;
}
}
!!!128410.cpp!!! way(in pro_dir : QString, in header : bool) : QString
QString dir;
if (stereotype() != "source") {
return stereotype() + " not yet managed";
}
else if (header) {
if (cppHeader().isEmpty())
return 0;
dir = ((UmlPackage *) parent()->parent())->cppHDir();
}
else {
if (cppSource().isEmpty())
return 0;
dir = ((UmlPackage *) parent()->parent())->cppSrcDir();
}
if (QDir::isRelativePath(dir)) {
QDir d(root_dir());
d.cd(dir);
dir = d.absPath();
}
if (dir.at(dir.length() - 1) != '/')
dir += "/";
if (pro_dir.at(pro_dir.length() - 1) != '/')
pro_dir += "/";
if (dir == pro_dir)
return "./";
// bypass common path header
unsigned index = 0;
unsigned i;
QString s;
for (;;) {
int i;
if ((i = pro_dir.find("/", index) + 1) != 0) {
if (pro_dir.left(i) == dir.left(i))
index = i;
else if (dir.length() == index) {
// pro_dir.left(index) == dir
do
s += "../";
while ((i = pro_dir.find("/", i) + 1) != 0);
return s;
}
else
break;
}
else
// dir.left(index + 1) == pro_dir
return dir.mid(index);
}
if (index == 0)
// path fully different
return dir;
// dir.left(index) == pro_dir.left(index)
// dir.mid(index) != pro_dir.mid(index) and they are not empty
// dir.at(index - 1) == pro_dir.at(index - 1) == '/'
i = index;
while ((i = pro_dir.find("/", i) + 1) != 0)
s += "../";
return s + dir.mid(index);
|