For PR798:

Add support for Graphviz. Patch contributed by Anton Korobeynikov.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-06-05 15:44:46 +00:00
parent c21051ff96
commit 3e0c154240
4 changed files with 220 additions and 40 deletions

View File

@@ -222,8 +222,9 @@ Path::isFile() const {
BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
if (rc)
return !(fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
else if (GetLastError() != ERROR_NOT_FOUND)
ThrowError(std::string(path) + ": Can't get status: ");
else if (GetLastError() != ERROR_FILE_NOT_FOUND) {
ThrowError("isFile(): " + std::string(path) + ": Can't get status: ");
}
return false;
}
@@ -233,8 +234,8 @@ Path::isDirectory() const {
BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
if (rc)
return fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
else if (GetLastError() != ERROR_NOT_FOUND)
ThrowError(std::string(path) + ": Can't get status: ");
else if (GetLastError() != ERROR_FILE_NOT_FOUND)
ThrowError("isDirectory(): " + std::string(path) + ": Can't get status: ");
return false;
}
@@ -244,8 +245,8 @@ Path::isHidden() const {
BOOL rc = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi);
if (rc)
return fi.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN;
else if (GetLastError() != ERROR_NOT_FOUND)
ThrowError(std::string(path) + ": Can't get status: ");
else if (GetLastError() != ERROR_FILE_NOT_FOUND)
ThrowError("isHidden(): " + std::string(path) + ": Can't get status: ");
return false;
}
@@ -336,7 +337,7 @@ void
Path::getStatusInfo(StatusInfo& info) const {
WIN32_FILE_ATTRIBUTE_DATA fi;
if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi))
ThrowError(std::string(path) + ": Can't get status: ");
ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: ");
info.fileSize = fi.nFileSizeHigh;
info.fileSize <<= 32;