mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-09 15:30:57 +00:00
no throw file open
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@250 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
parent
ca431e43f9
commit
a7a625dc3f
@ -26,6 +26,16 @@ File::File(File& f)
|
||||
f._fd = -1;
|
||||
}
|
||||
|
||||
File::File(const char *name, int flags, const std::nothrow_t&)
|
||||
{
|
||||
_fd = ::open(name, flags);
|
||||
}
|
||||
|
||||
File::File(const char *name, bool readOnly, const std::nothrow_t&)
|
||||
{
|
||||
_fd = ::open(name, readOnly ? O_RDONLY : O_RDWR);
|
||||
}
|
||||
|
||||
File::File(const char *name, int flags)
|
||||
{
|
||||
#undef __METHOD__
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __FILE_H__
|
||||
#define __FILE_H__
|
||||
|
||||
#include <new>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@ -12,8 +14,13 @@ class File {
|
||||
File();
|
||||
File(File &);
|
||||
File(int fd);
|
||||
|
||||
File(const char *name, int flags);
|
||||
File(const char *name, bool readOnly);
|
||||
|
||||
File(const char *name, int flags, const std::nothrow_t &);
|
||||
File(const char *name, bool readOnly, const std::nothrow_t &);
|
||||
|
||||
~File();
|
||||
|
||||
bool isValid() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user