本文整理汇总了C++中Proc::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::setName方法的具体用法?C++ Proc::setName怎么用?C++ Proc::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseCmd
//.........这里部分代码省略.........
}
unlink(cluster->getOutPath("xml"));
unlink(cluster->getOutPath("c"));
assert(cluster->getParent());
cluster->getParent()->removeChild(cluster);
} else {
std::cerr << "don't know how to delete a " << argv[1] << "\n";
return 1;
}
} else if (!strcmp(argv[0], "rename")) {
if (argc <= 1) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
if (!strcmp(argv[1], "proc")) {
if (argc <= 3) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Proc *proc = prog->findProc(argv[2]);
if (proc == NULL) {
std::cerr << "cannot find proc " << argv[2] << "\n";
return 1;
}
Proc *nproc = prog->findProc(argv[3]);
if (nproc != NULL) {
std::cerr << "proc " << argv[3] << " already exists\n";
return 1;
}
proc->setName(argv[3]);
} else if (!strcmp(argv[1], "cluster")) {
if (argc <= 3) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Cluster *cluster = prog->findCluster(argv[2]);
if (cluster == NULL) {
std::cerr << "cannot find cluster " << argv[2] << "\n";
return 1;
}
Cluster *ncluster = prog->findCluster(argv[3]);
if (ncluster == NULL) {
std::cerr << "cluster " << argv[3] << " already exists\n";
return 1;
}
cluster->setName(argv[3]);
} else {
std::cerr << "don't know how to rename a " << argv[1] << "\n";
return 1;
}
} else if (!strcmp(argv[0], "info")) {
if (argc <= 1) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
if (!strcmp(argv[1], "prog")) {
std::cout << "prog " << prog->getName() << ":\n";
std::cout << "\tclusters:\n";