MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / removeDirectory

Method removeDirectory

pluginManager/src/Utility.cpp:26–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "PluginManagerVersion.h"
25
26BOOL Utility::removeDirectory(const TCHAR* directory)
27{
28 tstring dir = directory;
29 tstring baseDir = directory;
30 baseDir.append(_T("\\"));
31
32 dir.append(_T("\\*"));
33 WIN32_FIND_DATA foundData;
34
35 HANDLE hFind = ::FindFirstFile(dir.c_str(), &foundData);
36 if (hFind != INVALID_HANDLE_VALUE)
37 {
38 do
39 {
40 if (foundData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
41 {
42 if (_tcscmp(foundData.cFileName, _T(".")) && _tcscmp(foundData.cFileName, _T("..")))
43 {
44 tstring thisDir(baseDir);
45 thisDir.append(foundData.cFileName);
46 removeDirectory(thisDir.c_str());
47
48 }
49 }
50 else
51 {
52 tstring thisFile(baseDir);
53 thisFile.append(foundData.cFileName);
54
55 ::DeleteFile(thisFile.c_str());
56 }
57 } while(::FindNextFile(hFind, &foundData));
58
59 ::FindClose(hFind);
60 }
61
62 ::RemoveDirectory(directory);
63
64 return TRUE;
65
66}
67
68
69void Utility::startGpup(HWND errorParent, const TCHAR *nppDir, const TCHAR *arguments, bool /* needAdmin */)

Callers

nothing calls this directly

Calls 2

c_strMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected