2014-11-15 15:16:18 +01:00
|
|
|
#pragma once
|
2015-10-15 13:04:57 +02:00
|
|
|
#ifndef MESSMER_FSPP_FSINTERFACE_OPENFILE_H_
|
|
|
|
#define MESSMER_FSPP_FSINTERFACE_OPENFILE_H_
|
2014-11-15 15:16:18 +01:00
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2014-11-16 00:05:28 +01:00
|
|
|
namespace fspp {
|
2014-11-15 23:47:38 +01:00
|
|
|
class Device;
|
2014-11-15 15:16:18 +01:00
|
|
|
|
2014-11-15 23:47:38 +01:00
|
|
|
class OpenFile {
|
2014-11-15 15:16:18 +01:00
|
|
|
public:
|
2014-11-15 23:47:38 +01:00
|
|
|
virtual ~OpenFile() {}
|
2014-11-15 16:33:24 +01:00
|
|
|
|
|
|
|
virtual void stat(struct ::stat *result) const = 0;
|
|
|
|
virtual void truncate(off_t size) const = 0;
|
2015-12-07 12:13:23 +01:00
|
|
|
virtual size_t read(void *buf, size_t count, off_t offset) const = 0;
|
2014-11-15 16:33:24 +01:00
|
|
|
virtual void write(const void *buf, size_t count, off_t offset) = 0;
|
2014-11-21 01:11:24 +01:00
|
|
|
virtual void flush() = 0;
|
2014-11-15 16:33:24 +01:00
|
|
|
virtual void fsync() = 0;
|
|
|
|
virtual void fdatasync() = 0;
|
2014-11-15 15:16:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-17 00:48:49 +01:00
|
|
|
#endif
|