#include "CryDir.h" #include #include #include #include #include "fspp/fuse/FuseErrnoException.h" #include "CryDevice.h" #include "CryFile.h" //TODO Get rid of this in favor of exception hierarchy using fspp::fuse::CHECK_RETVAL; using fspp::fuse::FuseErrnoException; namespace bf = boost::filesystem; using std::unique_ptr; using std::make_unique; using std::string; using std::vector; namespace cryfs { CryDir::CryDir(CryDevice *device, unique_ptr blob) : _device(device), _blob(std::move(blob)) { } CryDir::~CryDir() { } unique_ptr CryDir::createFile(const string &name, mode_t mode) { throw FuseErrnoException(ENOTSUP); } unique_ptr CryDir::createDir(const string &name, mode_t mode) { auto child = _device->CreateBlob(CryDevice::DIR_BLOBSIZE); _blob->AddChild(name, child.key); //TODO I don't think we need a return value in createDir for fspp. Change fspp! return make_unique(_device, make_unique(std::move(child.blob))); } void CryDir::rmdir() { throw FuseErrnoException(ENOTSUP); } unique_ptr> CryDir::children() const { return _blob->GetChildren(); } }