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:
Reid Spencer 2004-12-15 23:02:10 +00:00
parent e13f84b186
commit e56242780c
2 changed files with 4 additions and 4 deletions

View 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");

View 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());