consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include "Date.h"
Date::Date(unsigned int day, unsigned int month, unsigned int year) : day(day), month(month), year(year) {}
std::string Date::toString() const {
return std::to_string(day) + "." + std::to_string(month) + "." + std::to_string(year);
}
Date Date::getDateFromString(std::string date) {
for (int i = 0; i < date.size(); ++i) {
if ((date[i] < '0' or date[i] > '9') and date[i] != '.') throw UnparseableDateException(date);
}
std::string tmp;
unsigned int dd[3] = {0,0,0};
std::stringstream stram(date);
for (int i = 0; i < 3; ++i) {
getline (stram,tmp, '.');
dd[i] = std::stoi(tmp);
}
return {dd[0], dd[1], dd[2]};
}