#pragma once #include "RBTree/rbtree.h" #include "idirectoryentry.h" #include "cfstream.h" namespace CFCPP { class CFStorage : public CFItem { public: CFStorage(CompoundFile* compFile, const std::weak_ptr &dirEntry); std::shared_ptr getChildren(); std::shared_ptr AddStream(const std::wstring& streamName); std::shared_ptr GetStream(const std::wstring& streamName); bool TryGetStream(const std::wstring& streamName, std::shared_ptr &cfStream); std::shared_ptr GetStorage(const std::wstring& storageName); std::shared_ptr TryGetStorage(const std::wstring& storageName); bool TryGetStorage(const std::wstring& storageName, std::shared_ptr &cfStorage); std::shared_ptr AddStorage(const std::wstring& storageName); void VisitEntries(RedBlackTree::Action> action, bool recursive); void Delete(const std::wstring& entryName); void RenameItem(const std::wstring& oldItemName, const std::wstring& newItemName); std::streamsize size() const {return CFItem::size();} private: std::shared_ptr LoadChildren(int SID); private: std::shared_ptr children; }; }