From f24aa2064954b1c529621c8e6425d26c0c78b1bb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 4 Nov 2007 16:33:53 +0000 Subject: Allow ObjectExists() to take a std::string instead of just char *. --- lib/common/Utils.cpp | 6 +++--- lib/common/Utils.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/common') diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index 5dc03124..de392ef4 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -135,15 +135,15 @@ bool FileExists(const char *Filename, int64_t *pFileSize, bool TreatLinksAsNotEx // -------------------------------------------------------------------------- // // Function -// Name: ObjectExists(const char *) +// Name: ObjectExists(const std::string& rFilename) // Purpose: Does a object exist, and if so, is it a file or a directory? // Created: 23/11/03 // // -------------------------------------------------------------------------- -int ObjectExists(const char *Filename) +int ObjectExists(const std::string& rFilename) { struct stat st; - if(::stat(Filename, &st) != 0) + if(::stat(rFilename.c_str(), &st) != 0) { if(errno == ENOENT) { diff --git a/lib/common/Utils.h b/lib/common/Utils.h index 5da84d9a..d0842b51 100644 --- a/lib/common/Utils.h +++ b/lib/common/Utils.h @@ -29,7 +29,7 @@ enum ObjectExists_File = 1, ObjectExists_Dir = 2 }; -int ObjectExists(const char *Filename); +int ObjectExists(const std::string& rFilename); #include "MemLeakFindOff.h" -- cgit v1.2.3