mirror of
https://github.com/ksherlock/profuse.git
synced 2024-06-02 10:41:30 +00:00
34 lines
429 B
C++
34 lines
429 B
C++
#ifndef __FILE_H__
|
|
#define __FILE_H__
|
|
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
namespace File {
|
|
|
|
enum Flags {
|
|
ReadOnly = O_RDONLY,
|
|
WriteOnly = O_WRONLY,
|
|
ReadWrite = O_RDWR
|
|
};
|
|
|
|
class File {
|
|
|
|
public:
|
|
File();
|
|
File(File &);
|
|
File(int fd);
|
|
File(const char *name, int flags);
|
|
~File();
|
|
|
|
int fd() const { return _fd; }
|
|
|
|
void close();
|
|
|
|
private:
|
|
int _fd;
|
|
};
|
|
|
|
}
|
|
#endif
|