本文整理汇总了C++中LLMessageTemplate::getBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageTemplate::getBlock方法的具体用法?C++ LLMessageTemplate::getBlock怎么用?C++ LLMessageTemplate::getBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMessageTemplate
的用法示例。
在下文中一共展示了LLMessageTemplate::getBlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: message_skel
void LLMessageTemplateParserTestObject::test<6>()
// tests message parsing method on a simple message
{
std::string message_skel(
"{\n"
"TestMessage Low 1 NotTrusted Zerocoded\n"
"// comment \n"
" {\n"
"TestBlock1 Single\n"
" { Test1 U32 }\n"
" }\n"
" {\n"
" NeighborBlock Multiple 4\n"
" { Test0 U32 }\n"
" { Test1 U32 }\n"
" { Test2 U32 }\n"
" }\n"
"}");
LLTemplateTokenizer tokens(message_skel);
LLMessageTemplate * message = LLTemplateParser::parseMessage(tokens);
ensure("simple message parsed", message != 0);
ensure_equals("name of message", std::string(message->mName), std::string("TestMessage"));
ensure_equals("frequency is Low", message->mFrequency, MFT_LOW);
ensure_equals("trust is untrusted", message->mTrust, MT_NOTRUST);
ensure_equals("message number", message->mMessageNumber, (U32)((255 << 24) | (255 << 16) | 1));
ensure_equals("message encoding is zerocoded", message->mEncoding, ME_ZEROCODED);
ensure_equals("message deprecation is notdeprecated", message->mDeprecation, MD_NOTDEPRECATED);
LLMessageBlock * block = message->getBlock(prehash("NonexistantBlock"));
ensure("Nonexistant block does not exist", block == 0);
delete message;
}