本文整理汇总了C++中Option::setDriverOption方法的典型用法代码示例。如果您正苦于以下问题:C++ Option::setDriverOption方法的具体用法?C++ Option::setDriverOption怎么用?C++ Option::setDriverOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::setDriverOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInfo
Option *OptTable::CreateOption(unsigned id) const {
const Info &info = getInfo(id);
const OptionGroup *Group =
cast_or_null<OptionGroup>(getOption(info.GroupID));
const Option *Alias = getOption(info.AliasID);
Option *Opt = 0;
switch (info.Kind) {
case Option::InputClass:
Opt = new InputOption(id); break;
case Option::UnknownClass:
Opt = new UnknownOption(id); break;
case Option::GroupClass:
Opt = new OptionGroup(id, info.Name, Group); break;
case Option::FlagClass:
Opt = new FlagOption(id, info.Name, Group, Alias); break;
case Option::JoinedClass:
Opt = new JoinedOption(id, info.Name, Group, Alias); break;
case Option::SeparateClass:
Opt = new SeparateOption(id, info.Name, Group, Alias); break;
case Option::CommaJoinedClass:
Opt = new CommaJoinedOption(id, info.Name, Group, Alias); break;
case Option::MultiArgClass:
Opt = new MultiArgOption(id, info.Name, Group, Alias, info.Param); break;
case Option::JoinedOrSeparateClass:
Opt = new JoinedOrSeparateOption(id, info.Name, Group, Alias); break;
case Option::JoinedAndSeparateClass:
Opt = new JoinedAndSeparateOption(id, info.Name, Group, Alias); break;
}
if (info.Flags & DriverOption)
Opt->setDriverOption(true);
if (info.Flags & LinkerInput)
Opt->setLinkerInput(true);
if (info.Flags & NoArgumentUnused)
Opt->setNoArgumentUnused(true);
if (info.Flags & NoForward)
Opt->setNoForward(true);
if (info.Flags & RenderAsInput)
Opt->setNoOptAsInput(true);
if (info.Flags & RenderJoined) {
assert((info.Kind == Option::JoinedOrSeparateClass ||
info.Kind == Option::SeparateClass) && "Invalid option.");
Opt->setRenderStyle(Option::RenderJoinedStyle);
}
if (info.Flags & RenderSeparate) {
assert((info.Kind == Option::JoinedOrSeparateClass ||
info.Kind == Option::JoinedClass) && "Invalid option.");
Opt->setRenderStyle(Option::RenderSeparateStyle);
}
if (info.Flags & Unsupported)
Opt->setUnsupported(true);
if (info.Flags & CC1Option)
Opt->setIsCC1Option(true);
return Opt;
}
示例2: getInfo
Option *OptTable::constructOption(options::ID id) const {
Info &info = getInfo(id);
const OptionGroup *Group =
cast_or_null<OptionGroup>(getOption((options::ID) info.GroupID));
const Option *Alias = getOption((options::ID) info.AliasID);
Option *Opt = 0;
switch (info.Kind) {
case Option::InputClass:
Opt = new InputOption(); break;
case Option::UnknownClass:
Opt = new UnknownOption(); break;
case Option::GroupClass:
Opt = new OptionGroup(id, info.Name, Group); break;
case Option::FlagClass:
Opt = new FlagOption(id, info.Name, Group, Alias); break;
case Option::JoinedClass:
Opt = new JoinedOption(id, info.Name, Group, Alias); break;
case Option::SeparateClass:
Opt = new SeparateOption(id, info.Name, Group, Alias); break;
case Option::CommaJoinedClass:
Opt = new CommaJoinedOption(id, info.Name, Group, Alias); break;
case Option::MultiArgClass:
Opt = new MultiArgOption(id, info.Name, Group, Alias, info.Param); break;
case Option::JoinedOrSeparateClass:
Opt = new JoinedOrSeparateOption(id, info.Name, Group, Alias); break;
case Option::JoinedAndSeparateClass:
Opt = new JoinedAndSeparateOption(id, info.Name, Group, Alias); break;
}
for (const char *s = info.Flags; *s; ++s) {
switch (*s) {
default: assert(0 && "Invalid option flag.");
case 'J':
assert(info.Kind == Option::SeparateClass && "Invalid option.");
Opt->setForceJoinedRender(true); break;
case 'S':
assert(info.Kind == Option::JoinedClass && "Invalid option.");
Opt->setForceSeparateRender(true); break;
case 'd': Opt->setDriverOption(true); break;
case 'i': Opt->setNoOptAsInput(true); break;
case 'l': Opt->setLinkerInput(true); break;
case 'q': Opt->setNoArgumentUnused(true); break;
case 'u': Opt->setUnsupported(true); break;
}
}
return Opt;
}