本文整理汇总了C++中UmlPackage::supportFile方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlPackage::supportFile方法的具体用法?C++ UmlPackage::supportFile怎么用?C++ UmlPackage::supportFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlPackage
的用法示例。
在下文中一共展示了UmlPackage::supportFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileControl
void UmlPackage::fileControl(bool ci) {
UmlPackage * prj = getProject();
Q3CString prjfile = prj->supportFile();
BooL rec;
BooL reload;
Q3CString cmd;
if (! prj->propertyValue((ci) ? "check-in-cmd" : "check-out-cmd", cmd))
cmd = "specify the command containing %file and %dir or %dironly";
Dialog dialog(ci, cmd, rec, reload); // the dialog execution set 'cmd' and 'rec'
if (dialog.exec() == QDialog::Accepted) {
// save the command for a future usage
prj->set_PropertyValue((ci) ? "check-in-cmd" : "check-out-cmd", cmd);
if (reload)
saveProject();
// get files list
Q3Dict<void> files;
getFiles(files, (rec) ? ~0u : 1);
if (this == prj)
getAuxFiles(files);
// apply the command on each file
Q3DictIterator<void> it(files);
QFileInfo prjpath(prjfile);
QString dir = prjpath.dirPath(TRUE);
QString dironly = dir;
int index;
if ((dironly.length() > 3) &&
(((const char *) dironly)[1] == ':') &&
(((const char *) dironly)[2] == '/'))
dironly = dironly.mid(2);
while ((index = cmd.find("%dironly")) != -1)
cmd.replace(index, 8, dironly);
while ((index = cmd.find("%dir")) != -1)
cmd.replace(index, 4, dir);
while (it.current()) {
QString s = cmd;
while ((index = s.find("%file")) != -1)
s.replace(index, 5, it.currentKey());
system((const char *) s);
++it;
}
UmlCom::trace("Done.");
if (reload)
loadProject(prjfile);
}
}
示例2: fileControl
void UmlPackage::fileControl(bool ci)
{
UmlPackage * prj = getProject();
QByteArray prjfile = prj->supportFile();
BooL rec;
BooL reload;
QByteArray cmd;
if (! prj->propertyValue((ci) ? "check-in-cmd" : "check-out-cmd", cmd))
cmd = "specify the command containing %file and %dir or %dironly";
Dialog dialog(ci, cmd, rec, reload); // the dialog execution set 'cmd' and 'rec'
if (dialog.exec() == QDialog::Accepted) {
// save the command for a future usage
prj->set_PropertyValue((ci) ? "check-in-cmd" : "check-out-cmd", cmd);
if (reload)
saveProject();
// get files list
QHash<QString,void*> files;
getFiles(files, (rec) ? ~0u : 1);
if (this == prj)
getAuxFiles(files);
// apply the command on each file
QHashIterator<QString,void*> it(files);
QFileInfo prjpath(prjfile);
QString dir = prjpath.path();
QString dironly = dir;
int index;
if ((dironly.length() > 3) &&
(dironly[1] == ':') &&
(dironly[2] == '/'))
dironly = dironly.mid(2);
while ((index = cmd.indexOf("%dironly")) != -1)
cmd.replace(index, 8, dironly.toLatin1());
while ((index = cmd.indexOf("%dir")) != -1)
cmd.replace(index, 4, dir.toLatin1());
while (it.hasNext()) {
it.next();
QString s = cmd;
while ((index = s.indexOf("%file")) != -1)
s.replace(index, 5, it.key().toLatin1());
system((const char *) s.toLatin1().constData());
//++it;
}
UmlCom::trace("Done.");
if (reload)
loadProject(prjfile);
}
}