mirror of
https://github.com/ksherlock/profuse.git
synced 2024-06-04 08:29:32 +00:00
33 lines
476 B
C++
33 lines
476 B
C++
#ifndef __FILE_H__
|
|
#define __FILE_H__
|
|
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
|
|
class File {
|
|
|
|
public:
|
|
File();
|
|
File(File &);
|
|
File(int fd);
|
|
File(const char *name, int flags);
|
|
~File();
|
|
|
|
int fd() const { return _fd; }
|
|
|
|
void close();
|
|
|
|
void adopt(File &f);
|
|
void swap(File &f);
|
|
|
|
private:
|
|
|
|
// could call dup() or something.
|
|
File& operator=(const File &f);
|
|
int _fd;
|
|
};
|
|
|
|
#endif
|