MCPcopy Create free account
hub / github.com/SpartanJ/eepp / copyFile

Method copyFile

src/tools/ecode/uitreeviewfs.cpp:317–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void UITreeViewFS::copyFile( const std::string& src, const std::string& dst ) {
318 FileInfo srcInfo( src );
319 if ( !srcInfo.exists() )
320 return;
321 FileInfo dstInfo( dst );
322 if ( !dstInfo.exists() )
323 return;
324 if ( srcInfo.getFilepath() != srcInfo.getRealPath() )
325 srcInfo = FileInfo( srcInfo.getRealPath() );
326 if ( !dstInfo.isDirectory() ) {
327 dstInfo = FileInfo( dstInfo.getDirectoryPath() );
328 if ( dstInfo.getFilepath() != dstInfo.getRealPath() )
329 dstInfo = FileInfo( dstInfo.getRealPath() );
330 }
331 if ( srcInfo.getDirectoryPath() == dstInfo.getFilepath() )
332 return;
333
334 std::string srcPath( srcInfo.getFilepath() );
335 std::string dstPath( dstInfo.getFilepath() );
336 FileSystem::dirAddSlashAtEnd( dstPath );
337 dstPath += srcInfo.getFileName();
338 FileSystem::fileCopy( srcPath, dstPath );
339}
340
341void UITreeViewFS::copyFiles( const std::vector<std::string>& paths, const std::string& dstDir ) {
342 for ( const auto& srcPath : paths ) {

Callers

nothing calls this directly

Calls 4

getDirectoryPathMethod · 0.80
existsMethod · 0.45
getRealPathMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected