本文整理汇总了C++中OptionList::enabled方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionList::enabled方法的具体用法?C++ OptionList::enabled怎么用?C++ OptionList::enabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionList
的用法示例。
在下文中一共展示了OptionList::enabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enabled
bool JavaAssertions::enabled(const char* classname, bool systemClass) {
assert(classname != 0, "must have a classname");
// This will be slow if the number of assertion options on the command line is
// large--it traverses two lists, one of them multiple times. Could use a
// single n-ary tree instead of lists if someone ever notices.
// First check options that apply to classes. If we find a match we're done.
OptionList* p;
if (p = match_class(classname)) {
trace(classname, "class", p->name(), p->enabled());
return p->enabled();
}
// Now check packages, from most specific to least.
if (p = match_package(classname)) {
trace(classname, "package", p->name(), p->enabled());
return p->enabled();
}
// No match. Return the default status.
bool result = systemClass ? systemClassDefault() : userClassDefault();
trace(classname, systemClass ? "system" : "user", "default", result);
return result;
}