本文整理汇总了C++中ArgvIterator::matchOption方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgvIterator::matchOption方法的具体用法?C++ ArgvIterator::matchOption怎么用?C++ ArgvIterator::matchOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgvIterator
的用法示例。
在下文中一共展示了ArgvIterator::matchOption方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseCommandLineOptions
virtual bool parseCommandLineOptions(ArgvIterator &iter)
{
if (iter.done())
{
usage();
return false;
}
for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (*arg!='-')
{
if (optTarget.isEmpty())
optTarget.set(arg);
else if (optQueryId.isEmpty())
optQueryId.set(arg);
else
{
fprintf(stderr, "\nunrecognized argument %s\n", arg);
return false;
}
continue;
}
if (iter.matchOption(optPMID, ECLOPT_PMID) || iter.matchOption(optPMID, ECLOPT_PMID_S))
continue;
if (iter.matchFlag(optGlobalScope, ECLOPT_GLOBAL_SCOPE))
continue;
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}
示例2: parseCommandLineOptions
virtual bool parseCommandLineOptions(ArgvIterator &iter)
{
if (iter.done())
{
usage();
return false;
}
for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (*arg!='-')
{
optFileName.set(arg);
return true;
}
if (iter.matchOption(optProcess, ECLOPT_PROCESS))
continue;
if (iter.matchOption(optDaliIp, ECLOPT_DALIIP))
continue;
if (iter.matchFlag(optOverWrite, ECLOPT_OVERWRITE))
continue;
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}
示例3: parseCommandLineOptions
virtual bool parseCommandLineOptions(ArgvIterator &iter)
{
if (iter.done())
{
usage();
return false;
}
for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (streq(arg, "-"))
{
optObj.set("stdin");
continue;
}
if (*arg!='-')
{
if (optObj.value.length())
{
fprintf(stderr, "\nmultiple targets (%s and %s) not currently supported\n", optObj.value.sget(), arg);
return false;
}
optObj.set(arg);
continue;
}
if (iter.matchOption(optCluster, ECLOPT_CLUSTER))
continue;
if (iter.matchOption(optName, ECLOPT_NAME))
continue;
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}
示例4: matchCommandLineOption
esdlCmdOptionMatchIndicator EsdlConvertCmd::matchCommandLineOption(ArgvIterator &iter, bool finalAttempt)
{
if (iter.matchOption(optSource, ESDL_CONVERT_SOURCE))
return EsdlCmdOptionMatch;
if (iter.matchOption(optOutDirPath, ESDL_CONVERT_OUTDIR))
return EsdlCmdOptionMatch;
return EsdlCmdCommon::matchCommandLineOption(iter, true);
}
示例5: parseCommandLineOption
bool EsdlConvertCmd::parseCommandLineOption(ArgvIterator &iter)
{
if (iter.matchOption(optSource, ESDL_CONVERT_SOURCE))
return true;
if (iter.matchOption(optOutDirPath, ESDL_CONVERT_OUTDIR))
return true;
return false;
}
示例6: matchCommandLineOption
eclCmdOptionMatchIndicator EclCmdCommon::matchCommandLineOption(ArgvIterator &iter, bool finalAttempt)
{
bool boolValue;
if (iter.matchFlag(boolValue, ECLOPT_VERSION))
{
fprintf(stdout, "%s\n", BUILD_TAG);
return EclCmdOptionCompletion;
}
if (iter.matchOption(optServer, ECLOPT_SERVER)||iter.matchOption(optServer, ECLOPT_SERVER_S))
return EclCmdOptionMatch;
if (iter.matchOption(optPort, ECLOPT_PORT))
return EclCmdOptionMatch;
if (iter.matchOption(optUsername, ECLOPT_USERNAME)||iter.matchOption(optUsername, ECLOPT_USERNAME_S))
return EclCmdOptionMatch;
if (iter.matchOption(optPassword, ECLOPT_PASSWORD)||iter.matchOption(optPassword, ECLOPT_PASSWORD_S))
return EclCmdOptionMatch;
if (iter.matchFlag(optVerbose, ECLOPT_VERBOSE) || iter.matchFlag(optVerbose, ECLOPT_VERBOSE_S))
return EclCmdOptionMatch;
StringAttr tempArg;
if (iter.matchOption(tempArg, "-brk"))
{
#if defined(_WIN32) && defined(_DEBUG)
unsigned id = atoi(tempArg.sget());
if (id == 0)
DebugBreak();
else
_CrtSetBreakAlloc(id);
#endif
return EclCmdOptionMatch;
}
if (finalAttempt)
fprintf(stderr, "\n%s option not recognized\n", iter.query());
return EclCmdOptionNoMatch;
}
示例7: parseCommandLineOption
bool parseCommandLineOption(ArgvIterator &iter)
{
StringAttr oneOption;
if (iter.matchOption(oneOption, ESDLOPT_INCLUDE_PATH) || iter.matchOption(oneOption, ESDLOPT_INCLUDE_PATH_S))
{
if(optIncludePath.length() > 0)
optIncludePath.append(ENVSEPSTR);
optIncludePath.append(oneOption.get());
return true;
}
if (EsdlPublishCmdCommon::parseCommandLineOption(iter))
return true;
return false;
}
示例8: parseCommandLineOptions
virtual bool parseCommandLineOptions(ArgvIterator &iter)
{
if (iter.done())
{
usage();
return false;
}
for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (*arg!='-')
{
if (optTarget.isEmpty())
optTarget.set(arg);
else if (optFileName.isEmpty())
optFileName.set(arg);
else
{
fprintf(stderr, "\nunrecognized argument %s\n", arg);
return false;
}
continue;
}
if (iter.matchFlag(optValidateActive, ECLOPT_ACTIVE))
continue;
if (iter.matchFlag(optCheckDFS, ECLOPT_CHECK_DFS))
continue;
if (iter.matchOption(optPMID, ECLOPT_PMID) || iter.matchOption(optPMID, ECLOPT_PMID_S))
continue;
if (iter.matchFlag(optGlobalScope, ECLOPT_GLOBAL_SCOPE))
continue;
StringAttr queryIds;
if (iter.matchOption(queryIds, ECLOPT_QUERYID))
{
optQueryIds.appendList(queryIds.get(), ",");
continue;
}
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}