#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 blockStore); virtual ~CryDevice(); void statfs(const boost::filesystem::path &path, struct ::statvfs *fsstat) override; std::unique_ptr CreateBlock(size_t size); private: blockstore::Key GetOrCreateRootKey(CryConfig *config); blockstore::Key CreateRootBlockAndReturnKey(); std::unique_ptr Load(const bf::path &path) override; std::unique_ptr _block_store; blockstore::Key _root_key; DISALLOW_COPY_AND_ASSIGN(CryDevice); }; } #endif