本文整理汇总了C++中LLMessageTemplate::setDeprecation方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageTemplate::setDeprecation方法的具体用法?C++ LLMessageTemplate::setDeprecation怎么用?C++ LLMessageTemplate::setDeprecation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMessageTemplate
的用法示例。
在下文中一共展示了LLMessageTemplate::setDeprecation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// static
LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
{
LLMessageTemplate *templatep = NULL;
if(!tokens.want("{"))
{
return NULL;
}
// name first
std::string template_name = tokens.next();
// is name a legit C variable name
if (!b_variable_ok(template_name.c_str()))
{
llerrs << "Not legit variable name: " << template_name << " at " << tokens.line() << llendl;
}
// ok, now get Frequency ("High", "Medium", or "Low")
EMsgFrequency frequency = MFT_LOW;
std::string freq_string = tokens.next();
if (freq_string == "High")
{
frequency = MFT_HIGH;
}
else if (freq_string == "Medium")
{
frequency = MFT_MEDIUM;
}
else if (freq_string == "Low" || freq_string == "Fixed")
{
frequency = MFT_LOW;
}
else
{
llerrs << "Expected frequency, got " << freq_string << " at " << tokens.line() << llendl;
}
// TODO more explicit checking here pls
U32 message_number = strtoul(tokens.next().c_str(),NULL,0);
switch (frequency) {
case MFT_HIGH:
break;
case MFT_MEDIUM:
message_number = (255 << 8) | message_number;
break;
case MFT_LOW:
message_number = (255 << 24) | (255 << 16) | message_number;
break;
default:
llerrs << "Unknown frequency enum: " << frequency << llendl;
}
templatep = new LLMessageTemplate(
template_name.c_str(),
message_number,
frequency);
// Now get trust ("Trusted", "NotTrusted")
std::string trust = tokens.next();
if (trust == "Trusted")
{
templatep->setTrust(MT_TRUST);
}
else if (trust == "NotTrusted")
{
templatep->setTrust(MT_NOTRUST);
}
else
{
llerrs << "Bad trust " << trust << " at " << tokens.line() << llendl;
}
// get encoding
std::string encoding = tokens.next();
if(encoding == "Unencoded")
{
templatep->setEncoding(ME_UNENCODED);
}
else if(encoding == "Zerocoded")
{
templatep->setEncoding(ME_ZEROCODED);
}
else
{
llerrs << "Bad encoding " << encoding << " at " << tokens.line() << llendl;
}
// get deprecation
if(tokens.want("Deprecated"))
{
templatep->setDeprecation(MD_DEPRECATED);
}
else if (tokens.want("UDPDeprecated"))
{
templatep->setDeprecation(MD_UDPDEPRECATED);
}
else if (tokens.want("UDPBlackListed"))
{
//.........这里部分代码省略.........