本文整理汇总了C++中ConstIndexedIOPtr::entry方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstIndexedIOPtr::entry方法的具体用法?C++ ConstIndexedIOPtr::entry怎么用?C++ ConstIndexedIOPtr::entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstIndexedIOPtr
的用法示例。
在下文中一共展示了ConstIndexedIOPtr::entry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void PathMatcherData::load( LoadContextPtr context )
{
Data::load( context );
unsigned int v = g_ioVersion;
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
const IndexedIO::Entry stringsEntry = container->entry( "strings" );
std::vector<InternedString> strings;
strings.resize( stringsEntry.arrayLength() );
InternedString *stringsPtr = strings.data();
container->read( "strings", stringsPtr, stringsEntry.arrayLength() );
const IndexedIO::Entry pathLengthsEntry = container->entry( "pathLengths" );
std::vector<unsigned int> pathLengths;
pathLengths.resize( pathLengthsEntry.arrayLength() );
unsigned int *pathLengthsPtr = pathLengths.data();
container->read( "pathLengths", pathLengthsPtr, pathLengthsEntry.arrayLength() );
const IndexedIO::Entry exactMatchesEntry = container->entry( "exactMatches" );
std::vector<unsigned char> exactMatches;
exactMatches.resize( exactMatchesEntry.arrayLength() );
unsigned char *exactMatchesPtr = exactMatches.data();
container->read( "exactMatches", exactMatchesPtr, exactMatchesEntry.arrayLength() );
std::vector<InternedString> path;
for( size_t i = 0, e = pathLengths.size(); i < e; ++i )
{
path.resize( pathLengths[i] );
if( pathLengths[i] )
{
path.back() = *stringsPtr++;
}
if( exactMatches[i] )
{
writable().addPath( path );
}
}
}