本文整理汇总了C++中StringTable::Items方法的典型用法代码示例。如果您正苦于以下问题:C++ StringTable::Items方法的具体用法?C++ StringTable::Items怎么用?C++ StringTable::Items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringTable
的用法示例。
在下文中一共展示了StringTable::Items方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
//.........这里部分代码省略.........
i18nTextTableSize = htons(i18nTextTableSize);
traceMessageTableSize = htons(traceMessageTableSize);
traceCatalogTableSize = htons(traceCatalogTableSize);
errorMessageTableSize = htons(errorMessageTableSize);
stringTableSize = htons(stringTableSize);
std::vector<I18nText> texts;
for(size_t i = 0; i < i18nTextTableSize; ++ i)
{
I18nText text;
reader.Read((byte_t*)&text.key,sizeof(text.key));
reader.Read((byte_t*)&text.Message,sizeof(text.Message));
text.key = ntohl(text.key);
text.Message = ntohl(text.Message);
texts.push_back(text);
}
for(size_t i = 0; i < traceMessageTableSize; ++ i)
{
TraceMessage text;
reader.Read((byte_t*)&text.Id,sizeof(text.Id));
reader.Read((byte_t*)&text.Message,sizeof(text.Message));
text.Id = ntohl(text.Id);
text.Message = ntohl(text.Message);
_traceMessageTable[text.Id] = text;
}
for(size_t i = 0; i < traceCatalogTableSize; ++ i)
{
TraceCatalog text;
reader.Read((byte_t*)&text.Value,sizeof(text.Value));
reader.Read((byte_t*)&text.Name,sizeof(text.Name));
reader.Read((byte_t*)&text.Description,sizeof(text.Description));
text.Value = ntohl(text.Value);
text.Name = ntohl(text.Name);
text.Description = ntohl(text.Description);
_traceCatalogTable[text.Value] = text;
}
for(size_t i = 0; i < errorMessageTableSize; ++ i)
{
ErrorMessage text;
reader.Read((byte_t*)&text.Code,sizeof(text.Code));
reader.Read((byte_t*)&text.Name,sizeof(text.Name));
reader.Read((byte_t*)&text.Description,sizeof(text.Description));
text.Code = ntohl(text.Code);
text.Name = ntohl(text.Name);
text.Description = ntohl(text.Description);
_errorMessageTable[text.Code] = text;
}
StringTable table;
table.Read(stringTableSize, reader);
for(size_t i = 0 ; i < table.Items(); ++ i)
{
tuple<const lemon::byte_t*,size_t> result = table.Get((lemon::uint32_t)i);
lemon::String val = lemon::from_utf8((const char*)get<0>(result));
_stringTable.Push(__cbuf(val.c_str()));
}
for(size_t i = 0; i < i18nTextTableSize; ++ i)
{
_textTable[(const char_t*)get<0>(_stringTable.Get(texts[i].key))] = texts[i];
}
}