MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Run

Method Run

SpeedTest/Win32ApiTest.cpp:15–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15bool Win32ApiTest::Run(std::vector<TestOperation> const& paths)
16{
17 for (auto const& path : paths)
18 {
19 SHFILEOPSTRUCTW info{};
20 switch (path.operation)
21 {
22 case TestOperation::Operation::Copy: info.wFunc = FO_COPY; break;
23 case TestOperation::Operation::Move: info.wFunc = FO_MOVE; break;
24 case TestOperation::Operation::Delete: info.wFunc = FO_DELETE; break;
25 default:
26 throw std::runtime_error{ "Unknown operation" };
27 }
28 auto pFromBuffer = StringToMultiString(path.source);
29 info.pFrom = pFromBuffer.get();
30 auto pToBuffer = StringToMultiString(path.destination);
31 info.pTo = pToBuffer.get();
32 info.fFlags = FOF_NO_UI;
33 if (int const result = SHFileOperationW(&info); result != 0)
34 {
35 std::cerr << "Error code: " << result << " in SHFileOperationW\n";
36 return false;
37 }
38 }
39 return true;
40}
41
42std::string Win32ApiTest::GetName() const
43{

Callers

nothing calls this directly

Calls 2

StringToMultiStringFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected