本文整理汇总了C++中Options::VerifyPartialOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ Options::VerifyPartialOptions方法的具体用法?C++ Options::VerifyPartialOptions怎么用?C++ Options::VerifyPartialOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::VerifyPartialOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessAliasOptionsArgs
static bool ProcessAliasOptionsArgs(lldb::CommandObjectSP &cmd_obj_sp,
const char *options_args,
OptionArgVectorSP &option_arg_vector_sp) {
bool success = true;
OptionArgVector *option_arg_vector = option_arg_vector_sp.get();
if (!options_args || (strlen(options_args) < 1))
return true;
std::string options_string(options_args);
Args args(options_args);
CommandReturnObject result;
// Check to see if the command being aliased can take any command options.
Options *options = cmd_obj_sp->GetOptions();
if (options) {
// See if any options were specified as part of the alias; if so, handle
// them appropriately.
ExecutionContext exe_ctx =
cmd_obj_sp->GetCommandInterpreter().GetExecutionContext();
options->NotifyOptionParsingStarting(&exe_ctx);
args.Unshift("dummy_arg");
args.ParseAliasOptions(*options, result, option_arg_vector, options_string);
args.Shift();
if (result.Succeeded())
options->VerifyPartialOptions(result);
if (!result.Succeeded() &&
result.GetStatus() != lldb::eReturnStatusStarted) {
result.AppendError("Unable to create requested alias.\n");
return false;
}
}
if (!options_string.empty()) {
if (cmd_obj_sp->WantsRawCommandString())
option_arg_vector->push_back(
OptionArgPair("<argument>", OptionArgValue(-1, options_string)));
else {
const size_t argc = args.GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
if (strcmp(args.GetArgumentAtIndex(i), "") != 0)
option_arg_vector->push_back(OptionArgPair(
"<argument>",
OptionArgValue(-1, std::string(args.GetArgumentAtIndex(i)))));
}
}
return success;
}