int main(int argc, char *argv[], char* envp[]) { char options[] = "pisuU:dvV:cC:"; int c, dflg = 0, fflg = 0, gflg = 0; char *f_ptr, *g_ptr; while ((c = getopt(argc, argv, options)) != EOF) { switch (c) { case 'i': printRealAndEffectiveId(); break; case 's': makeMeLeader(); break; case 'p': printProcessId(); break; case 'u': printUlimit(); break; case 'U': setUlimit(optarg); break; case 'd': printCurrentDirectory(); break; case 'v': printEviron(); break; case 'V': setEnviron(optarg); break; case 'c': printCore(); break; case 'C': setCore(optarg); break; case '?': printf("invalid option is %c\n", optopt); } } }
void TestItem::setData(const QVariant & value, int role){ switch(role) { case DurationRole: setDuration(value.toDouble()); break; case ChecksumRole: setChecksum(value.toString()); break; case DependsRole: setDepends(value.toString()); break; case TestNameRole: setTestname(value.toString()); break; case RequiresRole: setRequires(value.toString()); break; case DescriptionRole: setDescription(value.toString()); break; case CommandRole: setCommand(value.toString()); break; case EnvironRole: setEnviron(value.toString()); break; case PluginRole: setPlugin(value.toString()); break; case TypeRole: setType(value.toString()); break; case UserRole: setUser(value.toString()); break; case ViaRole: setVia(value.toString()); break; case GroupRole: setGroup(value.toString()); break; case CheckRole: setCheck(value.toBool()); break; case ObjectPathRole: setObjectpath(value.toString()); break; case RunstatusRole: setRunstatus(value.toInt()); break; case ElapsedtimeRole: setElapsedtime(value.toInt()); break; case GroupstatusRole: setGroupstatus(value.toInt()); break; case ParentNameRole: //setGroupstatus(value.toStringList())); break; case ParentIdRole: //setGroupstatus(value.toStringList()); break; case DepthRole: setDepth(value.toInt()); break; case BranchRole: setBranch(value.toBool()); break; case IOLogRole: setIo_log(value.toString()); break; case CommentsRole: setComments(value.toString()); break; case OutcomeRole: setOutcome(value.toString()); break; case RerunRole: setRerun(value.toBool()); break; } }