#pragma once #ifndef CRYFS_LIB_CRYDEVICE_H_ #define CRYFS_LIB_CRYDEVICE_H_ #include #include "CryConfig.h" #include #include #include "fspp/utils/macros.h" namespace cryfs { namespace bf = boost::filesystem; class CryDevice: public fspp::Device { public: static constexpr size_t DIR_BLOCKSIZE = 4096; CryDevice(std::unique_ptr config, std::unique_ptr blockbStore); virtual ~CryDevice(); void statfs(const boost::filesystem::path &path, struct ::statvfs *fsstat) override; blockstore::BlockWithKey CreateBlock(size_t size); private: std::string CreateRootBlockAndReturnKey(); std::unique_ptr Load(const bf::path &path) override; std::unique_ptr _block_store; std::string _root_key; DISALLOW_COPY_AND_ASSIGN(CryDevice); }; } #endif