Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by Lorenzo Del Sordo on 2019-04-26.
- //
- #ifndef UNTITLED2_DIRECTORY_H
- #define UNTITLED2_DIRECTORY_H
- #include <vector>
- #include "Base.h"
- #include "File.h"
- class Directory: public Base {
- protected:
- Directory();
- private:
- static std::shared_ptr<Directory> instance;
- int type;
- std::vector<std::shared_ptr<Base>> list;
- std::weak_ptr<Directory> father;
- std::weak_ptr<Directory> me;
- public:
- static std::shared_ptr<Directory> getRoot();
- std::shared_ptr<Directory> addDirectory(std::string nome);
- std::shared_ptr<File> addFile(std::string nome,uintmax_t size);
- std::shared_ptr<Base> get(std::string name);
- std::shared_ptr<Base> getDir(std::string name);
- std::shared_ptr<File> getFile(std::string name);
- void remove(std::string nome);
- void ls(int indent=0) const override;
- int mType() const override ;
- };
- #endif //UNTITLED2_DIRECTORY_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement