Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Structures and data algorithms / Project / exc / Box.h
diff options
context:
space:
mode:
Commit0e9be940d16311036ee36aed47406481a26fdd82 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-12-27 12:36:09 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-12-27 12:36:09 +0200
Files037e24d902f1a5e32544fc41bd4e737ae491f8f8 /Year 2/Structures and data algorithms/Project/exc/Box.h
uni-projects-0e9be940d16311036ee36aed47406481a26fdd82.tar
uni-projects-0e9be940d16311036ee36aed47406481a26fdd82.tar.gz
uni-projects-0e9be940d16311036ee36aed47406481a26fdd82.zip
Parent06e1b9276cc1c709a24665399abebcdcefd3cb3e (diff)
[SDP/P] Only direct subboxes are removed in third exercise
1 files changed, 23 insertions, 0 deletions
-rw-r--r--Year 2/Structures and data algorithms/Project/exc/Box.h23
diff --git a/Year 2/Structures and data algorithms/Project/exc/Box.h b/Year 2/Structures and data algorithms/Project/exc/Box.h
new file mode 100644
index 0000000..2a0c71b
--- /dev/null
+++ b/Year 2/Structures and data algorithms/Project/exc/Box.h
@@ -0,0 +1,23 @@
+#ifndef BOX
+#define BOX
+
+#include <string>
+#include <vector>
+#include <ostream>
+#include <istream>
+
+class Box {
+ std::string name;
+ std::vector<std::string> items;
+ std::vector<Box*> subboxes;
+
+ std::ostream& printWithInd(std::ostream&, std::string);
+
+public:
+ Box(const std::string& name, const std::vector<std::string>& items, const std::vector<Box*> subboxes) : name(name), items(items), subboxes(subboxes) {}
+
+ void removeUselessSubBoxes();
+ std::ostream& print(std::ostream&);
+};
+
+#endif