mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
For PR495:
Change interface to Path class: readable -> canRead writable -> canWrite executable -> canExecute More (incremental) changes coming to close 495. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -139,14 +139,14 @@ static void getPathList(const char*path, std::vector<sys::Path>& Paths) {
|
||||
while( delim != 0 ) {
|
||||
std::string tmp(at, size_t(delim-at));
|
||||
if (tmpPath.setDirectory(tmp))
|
||||
if (tmpPath.readable())
|
||||
if (tmpPath.canRead())
|
||||
Paths.push_back(tmpPath);
|
||||
at = delim + 1;
|
||||
delim = strchr(at, ';');
|
||||
}
|
||||
if (*at != 0)
|
||||
if (tmpPath.setDirectory(std::string(at)))
|
||||
if (tmpPath.readable())
|
||||
if (tmpPath.canRead())
|
||||
Paths.push_back(tmpPath);
|
||||
|
||||
}
|
||||
@@ -167,7 +167,7 @@ Path::GetBytecodeLibraryPaths(std::vector<sys::Path>& Paths) {
|
||||
{
|
||||
Path tmpPath;
|
||||
if (tmpPath.setDirectory(LLVM_LIBDIR))
|
||||
if (tmpPath.readable())
|
||||
if (tmpPath.canRead())
|
||||
Paths.push_back(tmpPath);
|
||||
}
|
||||
#endif
|
||||
@@ -237,21 +237,21 @@ Path::exists() const {
|
||||
}
|
||||
|
||||
bool
|
||||
Path::readable() const {
|
||||
Path::canRead() const {
|
||||
// FIXME: take security attributes into account.
|
||||
DWORD attr = GetFileAttributes(path.c_str());
|
||||
return attr != INVALID_FILE_ATTRIBUTES;
|
||||
}
|
||||
|
||||
bool
|
||||
Path::writable() const {
|
||||
Path::canWrite() const {
|
||||
// FIXME: take security attributes into account.
|
||||
DWORD attr = GetFileAttributes(path.c_str());
|
||||
return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_READONLY);
|
||||
}
|
||||
|
||||
bool
|
||||
Path::executable() const {
|
||||
Path::canExecute() const {
|
||||
// FIXME: take security attributes into account.
|
||||
DWORD attr = GetFileAttributes(path.c_str());
|
||||
return attr != INVALID_FILE_ATTRIBUTES;
|
||||
|
Reference in New Issue
Block a user