forked from OSchip/llvm-project
Change the signatures of the destroyFile and destroyDirectory methods to
const because they affect the file system, not the Path object. llvm-svn: 18973
This commit is contained in:
parent
e13f84b186
commit
e56242780c
|
@ -492,7 +492,7 @@ Path::createTemporaryFile(bool reuse_current) {
|
|||
}
|
||||
|
||||
bool
|
||||
Path::destroyDirectory(bool remove_contents) {
|
||||
Path::destroyDirectory(bool remove_contents) const {
|
||||
// Make sure we're dealing with a directory
|
||||
if (!isDirectory()) return false;
|
||||
|
||||
|
@ -520,7 +520,7 @@ Path::destroyDirectory(bool remove_contents) {
|
|||
}
|
||||
|
||||
bool
|
||||
Path::destroyFile() {
|
||||
Path::destroyFile() const {
|
||||
if (!isFile()) return false;
|
||||
if (0 != unlink(path.c_str()))
|
||||
ThrowErrno(path + ": Can't destroy file");
|
||||
|
|
|
@ -503,7 +503,7 @@ Path::createFile() {
|
|||
}
|
||||
|
||||
bool
|
||||
Path::destroyDirectory(bool remove_contents) {
|
||||
Path::destroyDirectory(bool remove_contents) const {
|
||||
// Make sure we're dealing with a directory
|
||||
if (!isDirectory()) return false;
|
||||
|
||||
|
@ -532,7 +532,7 @@ Path::destroyDirectory(bool remove_contents) {
|
|||
}
|
||||
|
||||
bool
|
||||
Path::destroyFile() {
|
||||
Path::destroyFile() const {
|
||||
if (!isFile()) return false;
|
||||
|
||||
DWORD attr = GetFileAttributes(path.c_str());
|
||||
|
|
Loading…
Reference in New Issue