summaryrefslogtreecommitdiff
path: root/2022/Cpp/Day7/youssef.cpp
blob: 70daea03d1827bb18642d66d61a3c917fcfe64a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>

using namespace std;

class Dir {
private:
  string name;
  vector<Dir *> dir_list;
  unsigned int size;
  bool is_file;

public:
  Dir(string _name, unsigned int _size = 0) {
    this->name = _name;
    this->size = _size;

    this->is_file = true;
    if (_size == 0) {
      this->is_file = false;
    }
  }

  void add(Dir *dir) {
    dir_list.emplace_back(dir);
  }
};

class FileSystem {
private:
  Dir root_dir;
  map<string, Dir> map_dir;

public:
  void add_to_dir(string path, Dir* dir) {
    map_dir[path].add(dir);
  }

  void create_dir(string path, Dir dir) {
    if (!map_dir.count(path)) {
      map_dir[path] = dir;
    }
  }
};

void read_input() {
  string cur_dir = "";
}

int main() {
  return 0;
}