From f6886f1be8c0a6b95118672c3936c1fbaf53593f Mon Sep 17 00:00:00 2001 From: Ujjwal R <75781631+ujjwall-R@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:28:48 +0530 Subject: [PATCH] Implemented bit mask to memorize last used levels to beautify Dree output (#7) * print ascii changed * bitmask memorisation added for clean dree output * update .gitigore;make clean --- .gitignore | 3 ++- obj/controller/DirectoryGraph.o | Bin 56312 -> 0 bytes obj/main.o | Bin 13240 -> 0 bytes obj/model/DirectoryNode.o | Bin 13736 -> 0 bytes obj/view/Dree.o | Bin 936 -> 0 bytes src/controller/DirectoryGraph.cpp | 30 ++++++++++++++++++++++-------- src/controller/DirectoryGraph.h | 9 ++++----- src/main.cpp | 5 +++-- 8 files changed, 31 insertions(+), 16 deletions(-) delete mode 100644 obj/controller/DirectoryGraph.o delete mode 100644 obj/main.o delete mode 100644 obj/model/DirectoryNode.o delete mode 100644 obj/view/Dree.o diff --git a/.gitignore b/.gitignore index d45fc41..22e9802 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /compile/main -.vscode \ No newline at end of file +.vscode +obj \ No newline at end of file diff --git a/obj/controller/DirectoryGraph.o b/obj/controller/DirectoryGraph.o deleted file mode 100644 index f5b515e77290e9c336b6790e32ee2cac15c42540..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56312 zcmc(I4}4X{mH$m1DD@wy)fTI^X^IuKrb+lC2(=(QebI<4AuX-aM@SwfntvuQ5L8w) zP<@S2)?&-5ZCQ&JYg@6_mUXEOe=1mMjsGfIT2Zm$Lia~&*QLAe`um=lGxwf%-%Q@S zn%&Na`)1yE=KPs6XU@#M?@qWrUUNZlQITg-k$0XKd^4!$^?WNRPglk1-rL^4tG4s; zooK$u`DMs2=kfyNU*>WW`9dz&BVUB8fxkC$p5lBl@+-L9guI!{S0cZP%Pq)Tx!i`l zoy#4_ujX3G$^}?m@nc%hw>kmdneL|2>zlN4|o~Hz2=}%e}}~a(NZ< zuW!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`2$O}VA=o2Eb?D>$UpxiO+Q{|{%5%Vv`@43{}9WU^Jf5D!u|jBhwS$6 zX8BdVWL*gN|8&sX?qW>=} z`j=pxv-$4U>yST^1?Q9hHHZ8;7Wq$Dafg`fo6O`1wn?|0^B(ueI3! zDU1G3JLGR+`3)iah2`&Z$lu8F7c%`@$e+d)jvps~*gpPa`N3m3)0-?T|HGiSjbF(! zO)-WEN&d6A!t$?l$e+vd*$m7@>*{|&A?1)i&LaPLi~Qd@H<=&^I%EzWMiA(A(_qU8Cho|9{z{ z|1O98T`a#+v++N}_S@l*KgJ^e6^s01PqN$ZzYDbAVh8=veB+YO{<|FXCoz4#`M(47 zHv3mt`v1D6|Dz$m=06iyK9<+46t;h@gFfNVKTJOx^fvty7X9~I^#2;@$;PoPE%A4} zS-zPsrrLZr`K?C2X~6kHi~N5@ouM;+y&m*rzgVba9eLy%ao;xbL-ais`3EiX2U)(^ zCm6mxET7%jz)Dy8V&cGyOz$_~!WyOzj(&rtWh zolL(1&j)1+)4v1x%70`dlviJ)fk7sq`1vPXhTe>yO*T;`&Y(}vqxFf>UvRbH3e$f8 kSlIUfc{fj|PtTiqy3WmK*nYVEw9+r^)fC6`I^v@L|3O?HzW@LL diff --git a/obj/main.o b/obj/main.o deleted file mode 100644 index 2de60ae77076f9a600dac58b2e9719d4b9ea05cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13240 zcmd5?eT-aH6~D7XX_bO20#-meEG=yL80XFIwo5_We!O<39k!d@RvUyorZaE56J~eD znKyNp*np`t-7J{?hY4buU`S2XsPPZc1S>_Lh7ckNA%29!s98f3FdEZD!g_x9-Sg(o zn|F7%WeJ}2?Y;MR&(}ToFEiL$W#~wum9g`&nwQ zp$BrGqvu*xzmCf5Rs9Ak*Q$Dg${SU^hf1i1>^fDhr}Ac1zlF+PRo_76t*U+-mA9+< z9aJV&{R>p4RNbO7t?GTM>{sO`DhKJ=mzn+BSmwyNiDG8%lJ&5ZnYHJw)0rp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tc zy7*tQ@M8?ge4M)YPZGbhALD7}6r={(orU_nP2ewD9A3fc0|f(*G&(OaJlQz3_dL{oew9 zoBnQ#e(VxcKhATT{(m;8{}&GZ4_WjhWa>Xh`ir|0Do5`_shF=W&){ z>iI7e*xIi|_IDB^_8+dlru};z`X3`_V9}5B8~$SRXO8suvSLb2{jWOoFOYtZ_^|!)-pXwMj~x0}V50)nYyYzj{hhek z1IhV|W69LN3LLWepCbKyf24)MkLmx{9sK)0|2X< z>z8Noe>2oG{r|H=|19a3cO+;r=Sg)c;q9{#lEDyni3U?oN@49HR`T`D#t1_sh#frRp*#7K1FFYuE(^KbeK z;I8$7>ux>i{O-NGXFFCthvVBw2;dNK4gZW)fW9Z{g{+|mdjO-s;41Eq?(R?HR7oY% zSS9KrQAxU(>fjn;!fl zaHipV9AksDEgo>F1I{$`pI~Dbb5s8rdTGxD(+};)kuPG+=QCb depth) return; @@ -40,19 +40,33 @@ void DirectoryGraph::TraverseDirectoriesDFS(DirectoryNode *node, int depth, int } } -void DirectoryGraph::PrintGraph(DirectoryNode *node, int depth, int currentDepth) +void DirectoryGraph::PrintGraph(DirectoryNode *node, long long depth, long long currentDepth, bool isLastChild, long long mask) { if (currentDepth == depth) return; - for (int i = 0; i < currentDepth * depth; ++i) - cout << " "; - cout << "└── "; + for (long long i = 0; i < currentDepth; i++) + { + if (((mask >> i) & 1ll) == 0ll) + cout << "│ "; + else + cout << " "; + } + isLastChild ? cout << "└── " : cout << "├── "; cout << node->name << "\n"; - for (size_t i = 0; i < node->children.size(); ++i) + for (size_t i = 0; i < node->children.size(); i++) { DirectoryNode *child = node->children[i]; - PrintGraph(child, depth, currentDepth + 1); + if (i == node->children.size() - 1) + { + mask = mask | (1ll << (currentDepth + 1)); + } + PrintGraph(child, depth, currentDepth + 1, i == node->children.size() - 1, mask); } } + +void DirectoryGraph::PrintGraph(DirectoryNode *node, long long depth) +{ + this->PrintGraph(node, depth, 0, true, 1); +} \ No newline at end of file diff --git a/src/controller/DirectoryGraph.h b/src/controller/DirectoryGraph.h index 58373b1..408157c 100644 --- a/src/controller/DirectoryGraph.h +++ b/src/controller/DirectoryGraph.h @@ -11,14 +11,13 @@ using namespace std; class DirectoryGraph { public: - DirectoryNode *BuildGraph(const string &directoryName, int depth); - - void PrintGraph(DirectoryNode *node, int depth, int currentDepth = 0); + DirectoryNode *BuildGraph(const string &directoryName, long long depth); + void PrintGraph(DirectoryNode *node, long long depth); private: bool isDirectory(const std::string &pathStr); - - void TraverseDirectoriesDFS(DirectoryNode *node, int depth, int currentDepth = 0); + void TraverseDirectoriesDFS(DirectoryNode *node, long long depth, long long currentDepth = 0); + void PrintGraph(DirectoryNode *node, long long depth, long long currentDepth, bool isLastChild, long long mask); }; #endif diff --git a/src/main.cpp b/src/main.cpp index cb1c624..13ac231 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,9 +8,10 @@ using namespace std; int main() { + long long depth = 3; // should not be more than 60 auto currentPath = filesystem::current_path(); DirectoryGraph builder; - auto root = builder.BuildGraph(currentPath, 4); - builder.PrintGraph(root, 4); + auto root = builder.BuildGraph(currentPath, depth); + builder.PrintGraph(root, depth); return 0; }