chore: Add course material

This commit is contained in:
2026-10-05 11:27:21 +02:00
parent 971813c351
commit e8241fd1ff
660 changed files with 26658 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "PrintVisitor.h"
#include "CompanyEntry.h"
#include "GroupEntry.h"
#include "PersonEntry.h"
#include <iostream>
void PrintVisitor::visit(const PersonEntry &pe) {
std::cout << indent << "Person: " << pe.getName() << ' ' << pe.getPhone() << '\n';
}
void PrintVisitor::visit(const CompanyEntry &ce) {
std::cout << indent << "Company: " << ce.getName() << " <" << ce.getCategory() << "> " << ce.getPhone() << '\n';
}
void PrintVisitor::visit(const GroupEntry &ge) {
std::cout << indent << "Group: " << ge.getName() << '\n';
indent += " ";
}
void PrintVisitor::unVisit(const GroupEntry &) {
// Get rid of the extra indent we added
indent = indent.substr(indent.length() - 2, 2);
}