本文整理汇总了C++中symbol::bare_str方法的典型用法代码示例。如果您正苦于以下问题:C++ symbol::bare_str方法的具体用法?C++ symbol::bare_str怎么用?C++ symbol::bare_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类symbol
的用法示例。
在下文中一共展示了symbol::bare_str方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pp_symbol
static unsigned pp_symbol(std::ostream & out, symbol const & s) {
if (is_smt2_quoted_symbol(s)) {
std::string str = mk_smt2_quoted_symbol(s);
out << str;
return static_cast<unsigned>(str.length());
}
else if (s.is_numerical()) {
std::string str = s.str();
out << str;
return static_cast<unsigned>(str.length());
}
else {
out << s.bare_str();
return static_cast<unsigned>(strlen(s.bare_str()));
}
}
示例2: set_next_arg
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
cmd * c = ctx.find_cmd(s);
if (c == 0) {
std::string err_msg("unknown command '");
err_msg = err_msg + s.bare_str() + "'";
throw cmd_exception(err_msg);
}
m_cmds.push_back(s);
}
示例3: set_next_arg
void set_next_arg(cmd_context & ctx, symbol const & s) override {
cmd * c = ctx.find_cmd(s);
if (c == nullptr) {
std::string err_msg("unknown command '");
err_msg = err_msg + s.bare_str() + "'";
throw cmd_exception(std::move(err_msg));
}
m_cmds.push_back(s);
}
示例4: split_name
bool split_name(symbol const& name, symbol & prefix, symbol & suffix) const {
if (name.is_numerical()) return false;
char const* str = name.bare_str();
char const* period = strchr(str,'.');
if (!period) return false;
svector<char> prefix_((unsigned)(period-str), str);
prefix_.push_back(0);
prefix = symbol(prefix_.c_ptr());
suffix = symbol(period + 1);
return true;
}
示例5: string
std::string mk_smt2_quoted_symbol(symbol const & s) {
SASSERT(is_smt2_quoted_symbol(s));
string_buffer<> buffer;
buffer.append('|');
char const * str = s.bare_str();
while (*str) {
if (*str == '|' || *str == '\\')
buffer.append('\\');
buffer.append(*str);
str++;
}
buffer.append('|');
return std::string(buffer.c_str());
}
示例6: operator
bool operator()(symbol const & s1, symbol const & s2) const { return strcmp(s1.bare_str(), s2.bare_str()) < 0; }
示例7: is_smt2_quoted_symbol
bool is_smt2_quoted_symbol(symbol const & s) {
if (s.is_numerical())
return false;
return is_smt2_quoted_symbol(s.bare_str());
}
示例8: norm_param_name
std::string norm_param_name(symbol const & n) {
return norm_param_name(n.bare_str());
}