initial commit
This commit is contained in:
commit
8d6a6e2db2
5 changed files with 37 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.idea
|
||||
*build*
|
||||
8
CMakeLists.txt
Normal file
8
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
project(FileSystemEmulator)
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC FileSystemEmulator.cpp FileSystemEmulator.hpp)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC .)
|
||||
|
||||
add_executable(Test${PROJECT_NAME} Tests.cpp)
|
||||
target_link_libraries(Test${PROJECT_NAME} ${PROJECT_NAME})
|
||||
add_test(NAME Test${PROJECT_NAME} COMMAND Test${PROJECT_NAME})
|
||||
2
FileSystemEmulator.cpp
Normal file
2
FileSystemEmulator.cpp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
static void f() {}
|
||||
22
FileSystemEmulator.hpp
Normal file
22
FileSystemEmulator.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
// use tree for leafs in the node
|
||||
// use 8byte + 3byte for the name og the node, also key in the tree
|
||||
// don't store size in the tree
|
||||
// better use RB tree
|
||||
|
||||
// each node type has different size
|
||||
// implement node using virtual functions and inheritance
|
||||
// only directory node has leafs (tree)
|
||||
|
||||
// make two classes - emulator and interpreter
|
||||
// emulator stores only lower case names
|
||||
|
||||
// store number of incoming hard links in the node cache to ensure no hard-linked nodes can be removed
|
||||
|
||||
|
||||
// convert command to lowercase then use full path as the key and update key pointer when descending to the leafs
|
||||
|
||||
// each node has parent pointer to check for current directory
|
||||
|
||||
// base node class has all the cache data. use it directly in the tree
|
||||
3
Tests.cpp
Normal file
3
Tests.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "FileSystemEmulator.hpp"
|
||||
|
||||
int main() { return 0; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue