Update for changes in Path class interface for exception removal.
authorReid Spencer <rspencer@reidspencer.com>
Tue, 22 Aug 2006 22:46:39 +0000 (22:46 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 22 Aug 2006 22:46:39 +0000 (22:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29834 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Path.inc

index 8bc39f498db6a8fcb2745804b0f3a1b9dd340883..b40318fe27c301ecb468299e6574248dd4000943 100644 (file)
@@ -108,13 +108,16 @@ Path::isValid() const {
 static Path *TempDirectory = NULL;
 
 Path
-Path::GetTemporaryDirectory() {
+Path::GetTemporaryDirectory(std::string* ErrMsg) {
   if (TempDirectory)
     return *TempDirectory;
 
   char pathname[MAX_PATH];
-  if (!GetTempPath(MAX_PATH, pathname))
-    throw std::string("Can't determine temporary directory");
+  if (!GetTempPath(MAX_PATH, pathname)) {
+    if (ErrMsg)
+      *ErrMsg = "Can't determine temporary directory";
+    return Path();
+  }
 
   Path result;
   result.set(pathname);
@@ -134,19 +137,6 @@ Path::GetTemporaryDirectory() {
   return *TempDirectory;
 }
 
-Path::Path(const std::string& unverified_path)
-  : path(unverified_path)
-{
-  FlipBackSlashes(path);
-  if (unverified_path.empty())
-    return;
-  if (this->isValid())
-    return;
-  // oops, not valid.
-  path.clear();
-  throw std::string(unverified_path + ": path is not valid");
-}
-
 // FIXME: the following set of functions don't map to Windows very well.
 Path
 Path::GetRootDirectory() {