[Box Backup-commit] COMMIT r1962 - box/chris/general/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Dec 8 22:07:35 GMT 2007


Author: chris
Date: 2007-12-08 22:07:35 +0000 (Sat, 08 Dec 2007)
New Revision: 1962

Modified:
   box/chris/general/lib/common/Utils.cpp
   box/chris/general/lib/common/Utils.h
Log:
Allow ObjectExists() to take a std::string instead of just char *.
(merges [1920])


Modified: box/chris/general/lib/common/Utils.cpp
===================================================================
--- box/chris/general/lib/common/Utils.cpp	2007-12-08 22:04:49 UTC (rev 1961)
+++ box/chris/general/lib/common/Utils.cpp	2007-12-08 22:07:35 UTC (rev 1962)
@@ -135,15 +135,15 @@
 // --------------------------------------------------------------------------
 //
 // 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)
 		{

Modified: box/chris/general/lib/common/Utils.h
===================================================================
--- box/chris/general/lib/common/Utils.h	2007-12-08 22:04:49 UTC (rev 1961)
+++ box/chris/general/lib/common/Utils.h	2007-12-08 22:07:35 UTC (rev 1962)
@@ -29,7 +29,7 @@
 	ObjectExists_File = 1,
 	ObjectExists_Dir = 2
 };
-int ObjectExists(const char *Filename);
+int ObjectExists(const std::string& rFilename);
 
 #include "MemLeakFindOff.h"
 




More information about the Boxbackup-commit mailing list