本文整理汇总了C++中ArgvIterator::matchFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgvIterator::matchFlag方法的具体用法?C++ ArgvIterator::matchFlag怎么用?C++ ArgvIterator::matchFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgvIterator
的用法示例。
在下文中一共展示了ArgvIterator::matchFlag方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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!='-')
{
optFileName.set(arg);
return true;
}
if (iter.matchOption(optQuerySet, ECLOPT_QUERYSET))
continue;
if (iter.matchFlag(optActivate, ECLOPT_ACTIVATE))
continue;
if (iter.matchFlag(optOverWrite, ECLOPT_OVERWRITE))
continue;
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}
示例2: parseCommandLineOptions
bool EclCMDShell::parseCommandLineOptions(ArgvIterator &iter)
{
if (iter.done())
{
usage();
return false;
}
bool boolValue;
for (; !iter.done(); iter.next())
{
const char * arg = iter.query();
if (iter.matchFlag(optHelp, "help"))
continue;
else if (*arg!='-')
{
cmd.set(arg);
iter.next();
break;
}
else if (iter.matchFlag(boolValue, "--version"))
{
fprintf(stdout, "%s\n", BUILD_TAG);
return false;
}
}
return true;
}
示例3: 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;
}
示例4: parseCommandLineOption
bool parseCommandLineOption(ArgvIterator &iter)
{
if (iter.matchFlag(optTargetAddress, ESDL_OPTION_TARGET_ESP_ADDRESS))
return true;
if (iter.matchFlag(optTargetPort, ESDL_OPTION_TARGET_ESP_PORT) )
return true;
if (EsdlPublishCmdCommon::parseCommandLineOption(iter))
return true;
return false;
}
示例5: 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;
}
示例6: parseCommandLineOption
bool parseCommandLineOption(ArgvIterator &iter)
{
if (iter.matchFlag(optInput, ESDL_OPTION_CONFIG) )
return true;
if (EsdlPublishCmdCommon::parseCommandLineOption(iter))
return true;
return false;
}
示例7: 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;
}
示例8: matchCommandLineOption
esdlCmdOptionMatchIndicator EsdlCmdCommon::matchCommandLineOption(ArgvIterator &iter, bool finalAttempt)
{
bool boolValue;
if (iter.matchFlag(boolValue, ESDLOPT_HELP))
{
usage();
return EsdlCmdOptionCompletion;
}
if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
{
fprintf(stdout, "%s\n", BUILD_TAG);
return EsdlCmdOptionCompletion;
}
if (iter.matchFlag(optVerbose, ESDL_OPTION_VERBOSE) || iter.matchFlag(optVerbose, ESDL_OPT_VERBOSE))
{
return EsdlCmdOptionMatch;
}
StringAttr tempArg;
if (iter.matchOption(tempArg, "-brk"))
{
#if defined(_WIN32) && defined(_DEBUG)
unsigned id = atoi(tempArg.str());
if (id == 0)
DebugBreak();
else
_CrtSetBreakAlloc(id);
#endif
return EsdlCmdOptionMatch;
}
if (finalAttempt)
{
fprintf(stderr, "\n%s option not recognized\n", iter.query());
usage();
}
return EsdlCmdOptionNoMatch;
}
示例9: 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(optObj.value, ECLOPT_WUID))
continue;
if (iter.matchOption(optName, ECLOPT_NAME))
continue;
if (iter.matchOption(optCluster, ECLOPT_CLUSTER))
continue;
if (iter.matchFlag(optActivate, ECLOPT_ACTIVATE))
{
activateSet=true;
continue;
}
if (EclCmdCommon::matchCommandLineOption(iter, true)!=EclCmdOptionMatch)
return false;
}
return true;
}