// deployer Services implementation // Copyright (C) 2024 Jean-Cloud // GNU General Public License v3 #include #include #include #include "Services.h" Services::Services(const char *ServicesCSV) { services=readServicesFromCSV(ServicesCSV); } Services::~Services(){} vector Services::readServicesFromCSV (const char *CSV) const { vector result; FILE *streamServices=fopen(CSV,"r"); if (streamServices==NULL){ cout << "Invalid services.csv file." << endl; }else{ char line [1000]; int userID; string username; string serveur; list serveurs; while(fgets(line,sizeof(line),streamServices)!=NULL){ userID=atoi(strtok(line,";")); username=strtok(NULL,";"); //while loop serveur=strtok(NULL,";"); cout << serveur << " "; while(!serveur.empty()){ serveur=strtok(NULL,";"); //serveurs.push_back(serveur); cout << serveur << " "; } //serviceData entry = {userID,username,serveurs}; //cout << entry.userID <