2014-11-15 16:33:24 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef CRYFS_LIB_CRYDEVICE_H_
|
|
|
|
#define CRYFS_LIB_CRYDEVICE_H_
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
2014-11-15 23:47:38 +01:00
|
|
|
#include <fusepp/fs_interface/Device.h>
|
2014-11-15 16:33:24 +01:00
|
|
|
|
2014-11-15 17:24:07 +01:00
|
|
|
#include "fusepp/utils/macros.h"
|
2014-11-15 16:33:24 +01:00
|
|
|
|
|
|
|
namespace cryfs {
|
|
|
|
|
|
|
|
namespace bf = boost::filesystem;
|
|
|
|
|
2014-11-16 00:05:28 +01:00
|
|
|
class CryDevice: public fspp::Device {
|
2014-11-15 16:33:24 +01:00
|
|
|
public:
|
|
|
|
CryDevice(const bf::path &rootdir);
|
|
|
|
virtual ~CryDevice();
|
|
|
|
|
2014-11-15 17:24:07 +01:00
|
|
|
void statfs(const boost::filesystem::path &path, struct ::statvfs *fsstat) override;
|
2014-11-15 16:33:24 +01:00
|
|
|
|
|
|
|
const bf::path &RootDir() const;
|
|
|
|
private:
|
2014-11-16 00:05:28 +01:00
|
|
|
std::unique_ptr<fspp::Node> Load(const bf::path &path) override;
|
2014-11-15 16:33:24 +01:00
|
|
|
|
|
|
|
const bf::path _root_path;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CryDevice);
|
|
|
|
};
|
|
|
|
|
|
|
|
inline const bf::path &CryDevice::RootDir() const {
|
|
|
|
return _root_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
} /* namespace cryfs */
|
|
|
|
|
|
|
|
#endif /* CRYFS_LIB_CRYDEVICE_H_ */
|