MCPcopy Create free account
hub / github.com/ariccio/altWinDirStat / FindNBFDirectory

Function FindNBFDirectory

Reference code/osImageTool/XDAOSImageWriter.cpp:47–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 return path;
46}
47bool FindNBFDirectory(const string& basedir, string& directory)
48{
49 WIN32_FIND_DATA wfd;
50 HANDLE hFind= FindFirstFile(concatpath(basedir,"\\*").c_str(), &wfd);
51 if (hFind==NULL || hFind==INVALID_HANDLE_VALUE)
52 {
53 error("FindFirstFile('%s')", basedir.c_str());
54 return false;
55 }
56
57 int nDirectoryCount= 0;
58 do {
59 if (wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
60 {
61 if (strcmp(wfd.cFileName, ".") && strcmp(wfd.cFileName, ".."))
62 {
63 nDirectoryCount++;
64 if (nDirectoryCount==1)
65 directory= concatpath(basedir,wfd.cFileName);
66 }
67 }
68 } while (FindNextFile(hFind, &wfd));
69
70 FindClose(hFind);
71
72 return (nDirectoryCount==1);
73}
74
75XDAOsImageWriter::XDAOsImageWriter()
76{

Callers 1

XDAOsImageWriterMethod · 0.85

Calls 2

concatpathFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected