initialCommit 4 ans en retard

This commit is contained in:
tom
2026-06-03 22:48:34 +02:00
commit 4fc8a7be89
163 changed files with 28981 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#include "CreneauHoraire.h"
namespace modellib {
CreneauHoraire::CreneauHoraire(const CreneauHoraire &creneau) : m_debut(creneau.getDebutC()),
m_fin(creneau.getFinC()) {
}
CreneauHoraire::CreneauHoraire(const SolverDate &pdebut, const SolverDate &pfin)
: m_debut(pdebut), m_fin(pfin) {
}
nlohmann::json CreneauHoraire::to_json(bool format) const {
nlohmann::json creneau = nlohmann::json::object();
if (format) {
creneau["debut"] = m_debut.to_json(true);
creneau["fin"] = m_fin.to_json(true);
} else {
creneau["debut"] = m_debut.to_json();
creneau["fin"] = m_fin.to_json();
}
return creneau;
}
CreneauHoraire CreneauHoraire::from_json(nlohmann::json &json, bool format) {
CreneauHoraire creneau;
if (format) {
creneau.m_debut = SolverDate::from_json(json["debut"], true);
creneau.m_fin = SolverDate::from_json(json["fin"], true);
} else {
creneau.m_debut = SolverDate::from_json(json["debut"]);
creneau.m_fin = SolverDate::from_json(json["fin"]);
}
return creneau;
}
}