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

Function FilterFiles

Src/DropHandler.cpp:67–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 std::vector<String> FilterFiles(const std::vector<String>& files_src)
68 {
69 std::vector<String> files(files_src);
70 tchar_t szTempPath[MAX_PATH];
71 tchar_t szTempPathShort[MAX_PATH];
72 GetTempPath(sizeof(szTempPath) / sizeof(szTempPath[0]), szTempPath);
73 GetShortPathName(szTempPath, szTempPathShort, sizeof(szTempPathShort) / sizeof(szTempPathShort[0]));
74
75 for (UINT i = 0; i < files.size(); i++)
76 {
77 if (paths::IsShortcut(files[i]))
78 {
79 // if this was a shortcut, we need to expand it to the target path
80 String expandedFile = paths::ExpandShortcut(files[i]);
81
82 // if that worked, we should have a real file name
83 if (!expandedFile.empty())
84 files[i] = expandedFile;
85 }
86 else if (paths::IsDecendant(files[i], szTempPath) || paths::IsDecendant(files[i], szTempPathShort))
87 {
88 String tmpdir = env::GetTempChildPath();
89 CopyFileOrFolder(files[i], tmpdir);
90 files[i] = paths::ConcatPath(tmpdir, paths::FindFileName(files[i]));
91 }
92 }
93 return files;
94 }
95
96 HRESULT IStream_WriteToFile(IStream *pStream, const String& filename)
97 {

Callers 1

Calls 9

IsShortcutFunction · 0.85
ExpandShortcutFunction · 0.85
IsDecendantFunction · 0.85
GetTempChildPathFunction · 0.85
CopyFileOrFolderFunction · 0.85
ConcatPathFunction · 0.85
FindFileNameFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected