[Box Backup-commit] COMMIT r1689 - box/chris/general/lib/common
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sat, 26 May 2007 16:30:37 +0100
Author: chris
Date: 2007-05-26 16:30:37 +0100 (Sat, 26 May 2007)
New Revision: 1689
Modified:
box/chris/general/lib/common/Guards.h
Log:
Make FileHandleGuard take a std::string instead of a char array, C++ style
Modified: box/chris/general/lib/common/Guards.h
===================================================================
--- box/chris/general/lib/common/Guards.h 2007-05-26 15:30:05 UTC (rev 1688)
+++ box/chris/general/lib/common/Guards.h 2007-05-26 15:30:37 UTC (rev 1689)
@@ -32,13 +32,13 @@
class FileHandleGuard
{
public:
- FileHandleGuard(const char *filename)
- : mOSFileHandle(::open(filename, flags, mode))
+ FileHandleGuard(const std::string& rFilename)
+ : mOSFileHandle(::open(rFilename.c_str(), flags, mode))
{
if(mOSFileHandle < 0)
{
BOX_ERROR("FileHandleGuard: failed to open file '" <<
- filename << "': " << strerror(errno));
+ rFilename << "': " << strerror(errno));
THROW_EXCEPTION(CommonException, OSFileOpenError)
}
}