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

Function recursiveCopy

src/IECore/IndexedIOAlgo.cpp:209–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void recursiveCopy( const IndexedIO *src, IndexedIO *dst )
210{
211 IndexedIO::EntryIDList fileNames;
212 src->entryIds( fileNames, IndexedIO::EntryType::File );
213
214 for( const auto &fileName : fileNames )
215 {
216 int dummy = 0;
217 handleFile<Copier, int>( src, dst, fileName, dummy );
218 }
219
220 IndexedIO::EntryIDList directoryNames;
221 src->entryIds( directoryNames, IndexedIO::EntryType::Directory );
222
223 for( const auto &directoryName : directoryNames )
224 {
225 IndexedIOPtr childDst = dst->subdirectory( directoryName, IndexedIO::CreateIfMissing );
226 recursiveCopy( src->subdirectory( directoryName, IndexedIO::ThrowIfMissing ).get(), childDst.get() );
227 }
228}
229
230//! Task for traversing all files in parallel. New tasks are spawned for each directory
231template<template<typename, typename> class FileHandler, typename FileCallback>

Callers 1

copyFunction · 0.85

Calls 3

subdirectoryMethod · 0.80
entryIdsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected