本文整理汇总了C++中IndexedIOPtr::path方法的典型用法代码示例。如果您正苦于以下问题:C++ IndexedIOPtr::path方法的具体用法?C++ IndexedIOPtr::path怎么用?C++ IndexedIOPtr::path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexedIOPtr
的用法示例。
在下文中一共展示了IndexedIOPtr::path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exception
void Object::SaveContext::save( const Object *toSave, IndexedIO *container, const IndexedIO::EntryID &name )
{
if ( !toSave )
{
throw Exception( "Error trying to save NULL pointer object!" );
}
SavedObjectMap::const_iterator it = m_savedObjects->find( toSave );
if( it!=m_savedObjects->end() )
{
container->write( name, &(it->second[0]), it->second.size() );
}
else
{
bool rootObject = ( m_savedObjects->size() == 0 );
if ( rootObject )
{
if ( container->hasEntry( name ) )
{
container->remove( name );
}
}
IndexedIOPtr nameIO = container->createSubdirectory( name );
IndexedIO::EntryIDList pathParts;
nameIO->path( pathParts );
(*m_savedObjects)[toSave] = pathParts;
nameIO->write( g_typeEntry, toSave->typeName() );
IndexedIOPtr dataIO = nameIO->createSubdirectory( g_dataEntry );
dataIO->removeAll();
SaveContext context( dataIO, m_savedObjects );
toSave->save( &context );
// Objects saved on a file can be committed to disk to free memory.
if ( rootObject )
{
nameIO->commit();
}
}
}