Created
July 7, 2014 19:40
-
-
Save sumoward/3d53e4661d9b1b3d36c7 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
class FileEntity | |
{ | |
// members common to File & Folder | |
// create, copy, delete, move, getInfo, open, etc | |
}; | |
class Folder : public FileEntity | |
{ | |
// a folder can have multiple FileEntity (folders or files) | |
vector<FileEntity> m_VecFileEntity; | |
// members of Folder | |
}; | |
class File : public FileEntity | |
{ | |
// members of File | |
}; | |
class Drive | |
{ | |
// members of Drive | |
// getFreeSpace, getTotalSpace, createPartition, etc | |
}; | |
class FileSystem | |
{ | |
vector<FileEntity> m_VecFileEntity; | |
vector<Drive> m_vecDrives; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
interface BaseFileSystem
{
/*Basic file/folder attributes are:
1. File/Folder Size
2. File/Folder Date created
3. File/Folder Date Modified
4. File/Folder permissions - Read, write and execute
5. File/Folder Owner - Owner of the file who defines permissions for other users
6. File/Folder Visibility - Hidden or Visible
7. File/Folder Name
}
public class File implements BaseFileSystem
{
/The
File
class should implement all of the methods from interfaceBaseFilesystem
.In addition, it must also implement following specific methods that can only be associated with physical files/
}
public class Folder implements BaseFileSystem
{