diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-19 15:32:37 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-19 15:32:37 +0000 |
commit | 7c8397081c3d101fe467e8375601b091056465e0 (patch) | |
tree | c40f3e165ae04d0adc906d4b6476429adbb6db4e /lib/Support/Windows/Path.inc | |
parent | 8fe960ed50d3ad39d2a45f960ed8b9a69268035a (diff) | |
download | external_llvm-7c8397081c3d101fe467e8375601b091056465e0.zip external_llvm-7c8397081c3d101fe467e8375601b091056465e0.tar.gz external_llvm-7c8397081c3d101fe467e8375601b091056465e0.tar.bz2 |
Remove Path::getDirectoryContents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Path.inc')
-rw-r--r-- | lib/Support/Windows/Path.inc | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index 6b1e0f2..2f3dbba 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -302,54 +302,6 @@ bool Path::makeWriteableOnDisk(std::string* ErrMsg) { } bool -Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const { - WIN32_FILE_ATTRIBUTE_DATA fi; - if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) { - MakeErrMsg(ErrMsg, path + ": can't get status of file"); - return true; - } - - if (!(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - if (ErrMsg) - *ErrMsg = path + ": not a directory"; - return true; - } - - result.clear(); - WIN32_FIND_DATA fd; - std::string searchpath = path; - if (path.size() == 0 || searchpath[path.size()-1] == '/') - searchpath += "*"; - else - searchpath += "/*"; - - HANDLE h = FindFirstFile(searchpath.c_str(), &fd); - if (h == INVALID_HANDLE_VALUE) { - if (GetLastError() == ERROR_FILE_NOT_FOUND) - return true; // not really an error, now is it? - MakeErrMsg(ErrMsg, path + ": Can't read directory: "); - return true; - } - - do { - if (fd.cFileName[0] == '.') - continue; - Path aPath(path); - aPath.appendComponent(&fd.cFileName[0]); - result.insert(aPath); - } while (FindNextFile(h, &fd)); - - DWORD err = GetLastError(); - FindClose(h); - if (err != ERROR_NO_MORE_FILES) { - SetLastError(err); - MakeErrMsg(ErrMsg, path + ": Can't read directory: "); - return true; - } - return false; -} - -bool Path::set(StringRef a_path) { if (a_path.empty()) return false; |