MCPcopy Create free account
hub / github.com/WinMerge/winmerge / CopyFileOrFolder

Function CopyFileOrFolder

Src/DropHandler.cpp:24–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 typedef _com_ptr_t<_com_IIID<IShellItem, &__uuidof(IShellItem)>> IShellItemPtr;
23
24 bool CopyFileOrFolder(const String& src, const String& dst)
25 {
26 std::vector<tchar_t> srcpath(src.length() + 2, 0);
27 std::vector<tchar_t> dstpath(dst.length() + 2, 0);
28 memcpy(&srcpath[0], src.c_str(), src.length() * sizeof(tchar_t));
29 memcpy(&dstpath[0], dst.c_str(), dst.length() * sizeof(tchar_t));
30 SHFILEOPSTRUCT fileop = { 0, FO_COPY, &srcpath[0], &dstpath[0], FOF_NOCONFIRMATION, 0, 0, 0 };
31 return SHFileOperation(&fileop) == 0;
32 }
33
34 //
35 // OnDropFiles code from CDropEdit

Callers 1

FilterFilesFunction · 0.85

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected