OSDN Git Service

Change the signatures of the destroyFile and destroyDirectory methods to
authorReid Spencer <rspencer@reidspencer.com>
Wed, 15 Dec 2004 23:02:10 +0000 (23:02 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Wed, 15 Dec 2004 23:02:10 +0000 (23:02 +0000)
const because they affect the file system, not the Path object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18973 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Path.cpp
lib/System/Unix/Path.inc
lib/System/Win32/Path.cpp
lib/System/Win32/Path.inc

index 4a18c6b..a78b513 100644 (file)
@@ -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");
index 4a18c6b..a78b513 100644 (file)
@@ -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");
index d76dcd0..3e179ea 100644 (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());
index d76dcd0..3e179ea 100644 (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());