本文整理汇总了C++中param_descrs::display方法的典型用法代码示例。如果您正苦于以下问题:C++ param_descrs::display方法的具体用法?C++ param_descrs::display怎么用?C++ param_descrs::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类param_descrs
的用法示例。
在下文中一共展示了param_descrs::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw_unknown_parameter
void throw_unknown_parameter(symbol const & param_name, param_descrs const& d, symbol const & mod_name) {
if (mod_name == symbol::null) {
char const * new_name = get_new_param_name(param_name);
if (new_name) {
std::stringstream strm;
strm << "the parameter '" << param_name
<< "', invoke 'z3 -p' to obtain the new parameter list, and 'z3 -pp:" << new_name
<< "' for the full description of the parameter";
throw exception(strm.str());
}
else if (is_old_param_name(param_name)) {
std::stringstream strm;
strm << "unknown parameter '" << param_name
<< "', this is an old parameter name, invoke 'z3 -p' to obtain the new parameter list";
throw default_exception(strm.str());
}
else {
std::stringstream strm;
strm << "unknown parameter '" << param_name << "'\n";
strm << "Legal parameters are:\n";
d.display(strm, 2, false, false);
throw default_exception(strm.str());
}
}
else {
std::stringstream strm;
strm << "unknown parameter '" << param_name << "' ";
strm << "at module '" << mod_name << "'\n";
strm << "Legal parameters are:\n";
d.display(strm, 2, false, false);
throw default_exception(strm.str());
}
}
示例2: validate
void validate(param_descrs const & p) {
svector<params::entry>::iterator it = m_entries.begin();
svector<params::entry>::iterator end = m_entries.end();
symbol suffix, prefix;
for (; it != end; ++it) {
param_kind expected = p.get_kind_in_module(it->first);
if (expected == CPK_INVALID) {
std::stringstream strm;
strm << "unknown parameter '" << it->first.str() << "'\n";
strm << "Legal parameters are:\n";
p.display(strm, 2, false, false);
throw default_exception(strm.str());
}
if (it->second.m_kind != expected &&
!(it->second.m_kind == CPK_UINT && expected == CPK_NUMERAL)) {
std::stringstream strm;
strm << "Parameter " << it->first.str() << " was given argument of type ";
strm << it->second.m_kind << ", expected " << expected;
throw default_exception(strm.str());
}
}
}