本文整理汇总了C++中reference::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ reference::getString方法的具体用法?C++ reference::getString怎么用?C++ reference::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reference
的用法示例。
在下文中一共展示了reference::getString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModeHandler
CustomPrefixMode(Module* parent, ConfigTag* Tag)
: ModeHandler(parent, Tag->getString("name"), 0, PARAM_ALWAYS, MODETYPE_CHANNEL), tag(Tag)
{
list = true;
m_paramtype = TR_NICK;
std::string v = tag->getString("prefix");
prefix = v.c_str()[0];
v = tag->getString("letter");
mode = v.c_str()[0];
rank = tag->getInt("rank");
levelrequired = tag->getInt("ranktoset", rank);
depriv = tag->getBool("depriv", true);
}
示例2: dotag
void dotag()
{
last_tag = current;
std::string name;
nextword(name);
int spc = next();
if (spc == '>')
unget(spc);
else if (!isspace(spc))
throw CoreException("Invalid character in tag name");
if (name.empty())
throw CoreException("Empty tag name");
ConfigItems* items;
tag = ConfigTag::create(name, current.filename, current.line, items);
while (kv(items))
{
// Do nothing here (silences a GCC warning).
}
if (name == mandatory_tag)
{
// Found the mandatory tag
mandatory_tag.clear();
}
if (name == "include")
{
stack.DoInclude(tag, flags);
}
else if (name == "files")
{
for(ConfigItems::iterator i = items->begin(); i != items->end(); i++)
{
stack.DoReadFile(i->first, i->second, flags, false);
}
}
else if (name == "execfiles")
{
for(ConfigItems::iterator i = items->begin(); i != items->end(); i++)
{
stack.DoReadFile(i->first, i->second, flags, true);
}
}
else if (name == "define")
{
if (flags & FLAG_USE_COMPAT)
throw CoreException("<define> tags may only be used in XML-style config (add <config format=\"xml\">)");
std::string varname = tag->getString("name");
std::string value = tag->getString("value");
if (varname.empty())
throw CoreException("Variable definition must include variable name");
stack.vars[varname] = value;
}
else if (name == "config")
{
std::string format = tag->getString("format");
if (format == "xml")
flags &= ~FLAG_USE_COMPAT;
else if (format == "compat")
flags |= FLAG_USE_COMPAT;
else if (!format.empty())
throw CoreException("Unknown configuration format " + format);
}
else
{
stack.output.insert(std::make_pair(name, tag));
}
// this is not a leak; reference<> takes care of the delete
tag = NULL;
}