mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-02 09:16:40 +00:00
Update for changes in Path class interface for exception removal.
llvm-svn: 29834
This commit is contained in:
parent
1a229fcae9
commit
89a87abbff
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user