本文整理汇总了C++中MythCommFlagCommandLineParser::toInt方法的典型用法代码示例。如果您正苦于以下问题:C++ MythCommFlagCommandLineParser::toInt方法的具体用法?C++ MythCommFlagCommandLineParser::toInt怎么用?C++ MythCommFlagCommandLineParser::toInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythCommFlagCommandLineParser
的用法示例。
在下文中一共展示了MythCommFlagCommandLineParser::toInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
int result = GENERIC_EXIT_OK;
// QString allStart = "19700101000000";
// QString allEnd = MythDate::current().toString("yyyyMMddhhmmss");
int jobType = JOB_NONE;
if (!cmdline.Parse(argc, argv))
{
cmdline.PrintHelp();
return GENERIC_EXIT_INVALID_CMDLINE;
}
if (cmdline.toBool("showhelp"))
{
cmdline.PrintHelp();
return GENERIC_EXIT_OK;
}
if (cmdline.toBool("showversion"))
{
cmdline.PrintVersion();
return GENERIC_EXIT_OK;
}
QCoreApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHCOMMFLAG);
int retval = cmdline.ConfigureLogging("general",
!cmdline.toBool("noprogress"));
if (retval != GENERIC_EXIT_OK)
return retval;
CleanupGuard callCleanup(cleanup);
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init( false, /*use gui*/
false, /*prompt for backend*/
false, /*bypass auto discovery*/
cmdline.toBool("skipdb"))) /*ignoreDB*/
{
LOG(VB_GENERAL, LOG_EMERG, "Failed to init MythContext, exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}
cmdline.ApplySettingsOverride();
MythTranslation::load("mythfrontend");
if (cmdline.toBool("outputmethod"))
{
QString om = cmdline.toString("outputmethod");
if (outputTypes->contains(om))
outputMethod = outputTypes->value(om);
}
if (cmdline.toBool("chanid") && cmdline.toBool("starttime"))
{
// operate on a recording in the database
uint chanid = cmdline.toUInt("chanid");
QDateTime starttime = cmdline.toDateTime("starttime");
if (cmdline.toBool("clearskiplist"))
return ClearSkipList(chanid, starttime);
if (cmdline.toBool("gencutlist"))
return CopySkipListToCutList(chanid, starttime);
if (cmdline.toBool("clearcutlist"))
return SetCutList(chanid, starttime, "");
if (cmdline.toBool("setcutlist"))
return SetCutList(chanid, starttime, cmdline.toString("setcutlist"));
if (cmdline.toBool("getcutlist"))
return GetMarkupList("cutlist", chanid, starttime);
if (cmdline.toBool("getskiplist"))
return GetMarkupList("commflag", chanid, starttime);
// TODO: check for matching jobid
// create temporary id to operate off of if not
if (cmdline.toBool("queue"))
QueueCommFlagJob(chanid, starttime, cmdline.toBool("rebuild"));
else if (cmdline.toBool("rebuild"))
result = RebuildSeekTable(chanid, starttime, -1);
else
result = FlagCommercials(chanid, starttime, -1,
cmdline.toString("outputfile"), true);
}
else if (cmdline.toBool("jobid"))
{
jobID = cmdline.toInt("jobid");
uint chanid;
//.........这里部分代码省略.........
示例2: main
int main(int argc, char *argv[])
{
int result = GENERIC_EXIT_OK;
// QString allStart = "19700101000000";
// QString allEnd = MythDate::current().toString("yyyyMMddhhmmss");
int jobType = JOB_NONE;
if (!cmdline.Parse(argc, argv))
{
cmdline.PrintHelp();
return GENERIC_EXIT_INVALID_CMDLINE;
}
if (cmdline.toBool("showhelp"))
{
cmdline.PrintHelp();
return GENERIC_EXIT_OK;
}
if (cmdline.toBool("showversion"))
{
cmdline.PrintVersion();
return GENERIC_EXIT_OK;
}
QCoreApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHCOMMFLAG);
int retval = cmdline.ConfigureLogging("general",
!cmdline.toBool("noprogress"));
if (retval != GENERIC_EXIT_OK)
return retval;
CleanupGuard callCleanup(cleanup);
#ifndef _WIN32
QList<int> signallist;
signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
<< SIGILL;
#if ! CONFIG_DARWIN
signallist << SIGRTMIN;
#endif
SignalHandler::Init(signallist);
signal(SIGHUP, SIG_IGN);
#endif
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init( false, /*use gui*/
false, /*prompt for backend*/
false, /*bypass auto discovery*/
cmdline.toBool("skipdb"))) /*ignoreDB*/
{
LOG(VB_GENERAL, LOG_EMERG, "Failed to init MythContext, exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}
cmdline.ApplySettingsOverride();
MythTranslation::load("mythfrontend");
if (cmdline.toBool("outputmethod"))
{
QString om = cmdline.toString("outputmethod");
if (outputTypes->contains(om))
outputMethod = outputTypes->value(om);
}
if (cmdline.toBool("chanid") && cmdline.toBool("starttime"))
{
// operate on a recording in the database
uint chanid = cmdline.toUInt("chanid");
QDateTime starttime = cmdline.toDateTime("starttime");
if (cmdline.toBool("clearskiplist"))
return ClearSkipList(chanid, starttime);
if (cmdline.toBool("gencutlist"))
return CopySkipListToCutList(chanid, starttime);
if (cmdline.toBool("clearcutlist"))
return SetCutList(chanid, starttime, "");
if (cmdline.toBool("setcutlist"))
return SetCutList(chanid, starttime, cmdline.toString("setcutlist"));
if (cmdline.toBool("getcutlist"))
return GetMarkupList("cutlist", chanid, starttime);
if (cmdline.toBool("getskiplist"))
return GetMarkupList("commflag", chanid, starttime);
// TODO: check for matching jobid
// create temporary id to operate off of if not
if (cmdline.toBool("queue"))
QueueCommFlagJob(chanid, starttime, cmdline.toBool("rebuild"));
else if (cmdline.toBool("rebuild"))
result = RebuildSeekTable(chanid, starttime, -1);
else
result = FlagCommercials(chanid, starttime, -1,
cmdline.toString("outputfile"), true);
}
else if (cmdline.toBool("jobid"))
{
jobID = cmdline.toInt("jobid");
uint chanid;
//.........这里部分代码省略.........
示例3: main
int main(int argc, char *argv[])
{
bool isVideo = false;
int result = GENERIC_EXIT_OK;
QString filename;
QString outputfilename = QString::null;
QDateTime starttime;
QString allStart = "19700101000000";
QString allEnd = QDateTime::currentDateTime().toString("yyyyMMddhhmmss");
int jobType = JOB_NONE;
QDir fullfile;
QString newCutList = QString::null;
if (!cmdline.Parse(argc, argv))
{
cmdline.PrintHelp();
return GENERIC_EXIT_INVALID_CMDLINE;
}
if (cmdline.toBool("showhelp"))
{
cmdline.PrintHelp();
return GENERIC_EXIT_OK;
}
if (cmdline.toBool("showversion"))
{
cmdline.PrintVersion();
return GENERIC_EXIT_OK;
}
QCoreApplication a(argc, argv);
QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHCOMMFLAG);
int retval;
if ((retval = cmdline.ConfigureLogging(
"important general",
!cmdline.toBool("noprogress"))) != GENERIC_EXIT_OK)
return retval;
CleanupGuard callCleanup(cleanup);
gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init( false, /*use gui*/
false, /*prompt for backend*/
false, /*bypass auto discovery*/
cmdline.toBool("skipdb"))) /*ignoreDB*/
{
LOG(VB_GENERAL, LOG_EMERG, "Failed to init MythContext, exiting.");
return GENERIC_EXIT_NO_MYTHCONTEXT;
}
cmdline.ApplySettingsOverride();
MythTranslation::load("mythfrontend");
if (cmdline.toBool("chanid") && cmdline.toBool("starttime"))
{
// operate on a recording in the database
uint chanid = cmdline.toUInt("chanid");
QDateTime starttime = cmdline.toDateTime("starttime");
if (cmdline.toBool("clearskiplist"))
return ClearSkipList(chanid, starttime);
if (cmdline.toBool("gencutlist"))
return CopySkipListToCutList(chanid, starttime);
if (cmdline.toBool("clearcutlist"))
return SetCutList(chanid, starttime, "");
if (cmdline.toBool("setcutlist"))
return SetCutList(chanid, starttime, cmdline.toString("setcutlist"));
if (cmdline.toBool("getcutlist"))
return GetMarkupList("cutlist", chanid, starttime);
if (cmdline.toBool("getskiplist"))
return GetMarkupList("commflag", chanid, starttime);
// TODO: check for matching jobid
// create temporary id to operate off of if not
if (cmdline.toBool("queue"))
QueueCommFlagJob(chanid, starttime, cmdline.toBool("rebuild"));
else if (cmdline.toBool("rebuild"))
result = RebuildSeekTable(chanid, starttime, -1);
else
result = FlagCommercials(chanid, starttime, -1, "");
}
else if (cmdline.toBool("jobid"))
{
jobID = cmdline.toInt("jobid");
uint chanid;
QDateTime starttime;
if (!JobQueue::GetJobInfoFromID(jobID, jobType, chanid, starttime))
{
cerr << "mythcommflag: ERROR: Unable to find DB info for "
<< "JobQueue ID# " << jobID << endl;
return GENERIC_EXIT_NO_RECORDING_DATA;
}
inJobQueue = true;
force = true;
int jobQueueCPU = gCoreContext->GetNumSetting("JobQueueCPU", 0);
//.........这里部分代码省略.........