-
-
Save HappyCerberus/38d5aed6d2163f5d302d45d3d395e0ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Directory { | |
// Required for "$ cd ..". | |
Directory *parent = nullptr; | |
// Required for "$ cd subdirectory". | |
std::unordered_map<std::string, Directory*> subdirs; | |
// Information about files. | |
std::unordered_map<std::string, size_t> files; | |
}; | |
struct Tree { | |
// Directory root. | |
Directory root; | |
// Storage for all Directories. | |
std::vector<std::unique_ptr<Directory>> storage; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment