Changeset 1689

Show
Ignore:
Timestamp:
26/05/2007 16:30:37 (20 months ago)
Author:
chris
Message:

Make FileHandleGuard? take a std::string instead of a char array, C++ style

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • box/chris/general/lib/common/Guards.h

    r1468 r1689  
    3333{ 
    3434public: 
    35         FileHandleGuard(const char *filename) 
    36                 : mOSFileHandle(::open(filename, flags, mode)) 
     35        FileHandleGuard(const std::string& rFilename) 
     36                : mOSFileHandle(::open(rFilename.c_str(), flags, mode)) 
    3737        { 
    3838                if(mOSFileHandle < 0) 
    3939                { 
    4040                        BOX_ERROR("FileHandleGuard: failed to open file '" << 
    41                                 filename << "': " << strerror(errno)); 
     41                                rFilename << "': " << strerror(errno)); 
    4242                        THROW_EXCEPTION(CommonException, OSFileOpenError) 
    4343                }