MCPcopy Create free account
hub / github.com/ImageEngine/cortex / addChild

Method addChild

src/IECore/StreamIndexedIO.cpp:1407–1431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1405}
1406
1407DirectoryNode* StreamIndexedIO::Node::addChild( const IndexedIO::EntryID &childName )
1408{
1409 if ( m_node->subindex() )
1410 {
1411 throw Exception( "Cannot modify the file at current location! It was already committed to the file." );
1412 }
1413
1414 if ( hasChild(childName) )
1415 {
1416 return nullptr;
1417 }
1418
1419 DirectoryNode* child = new DirectoryNode(childName);
1420 if ( !child )
1421 {
1422 throw Exception( "Failed to allocate node!" );
1423 }
1424 m_idx->m_stringCache.add( childName );
1425
1426 m_node->registerChild( child );
1427
1428 m_idx->m_hasChanged = true;
1429
1430 return child;
1431}
1432
1433void StreamIndexedIO::Node::addDataChild(
1434 const IndexedIO::EntryID &childName,

Callers 4

setRootMethod · 0.45
subdirectoryMethod · 0.45
createSubdirectoryMethod · 0.45
directoryMethod · 0.45

Calls 3

subindexMethod · 0.80
registerChildMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected