avec dossiers

This commit is contained in:
eleonore12345 2024-08-01 18:22:15 +02:00
parent e2a37fae16
commit d81176ffa6
19 changed files with 12 additions and 10 deletions

BIN
Module.o

Binary file not shown.

Binary file not shown.

BIN
bin/deployer Executable file

Binary file not shown.

BIN
deployer

Binary file not shown.

BIN
main.o

Binary file not shown.

View File

@ -1,17 +1,20 @@
ECHO = @echo ECHO = @echo
GCC = g++ GCC = g++
RM = @rm -f RM = @rm -f
CCFLAGS = -c -g -std=c++11 -pedantic -Wall #optimization? CCFLAGS = -c -O3 -g -std=c++11 -pedantic -Wall
OBJETS = $(SRC:.cpp=.o) OBJETS = $(SRC:.cpp=.o)
SRC = $(wildcard *.cpp) SRC = $(wildcard *.cpp)
EXE = deployer EXE = deployer
BIN = ../bin
OBJETS_DIR = $(OBJETS:%=$(BIN)/%)
EXE_DIR = $(EXE:%=$(BIN)/%)
LIBRARIES = LIBRARIES =
$(EXE) : $(OBJETS) $(EXE_DIR) : $(OBJETS_DIR)
$(ECHO) "-Linking $(EXE)-" $(ECHO) "-Linking $(EXE)-"
$(GCC) -o $@ $^ $(LIBRARIES) $(GCC) -o $@ $^ $(LIBRARIES)
%.o:%.cpp $(BIN)/%.o:%.cpp
$(ECHO) "-Compilation $<- " $(ECHO) "-Compilation $<- "
$(GCC) $(CCFLAGS) -o $@ $< $(GCC) $(CCFLAGS) -o $@ $<

View File

@ -9,14 +9,14 @@
#include <string> #include <string>
#include "Services.h" #include "Services.h"
Services::Services(const char *ServicesCSV) Services::Services(string ServicesCSV)
{ {
services=readServicesFromCSV(ServicesCSV); services=readServicesFromCSV(ServicesCSV);
} }
Services::~Services(){} Services::~Services(){}
vector <serviceData> Services::readServicesFromCSV (const char *CSV) const vector <serviceData> Services::readServicesFromCSV (string CSV) const
{ {
//this method extracts the list of uid|username|servers from the services.csv file //this method extracts the list of uid|username|servers from the services.csv file
//and returns them in a vector <serviceData>, with serviceData a structure defined in the header //and returns them in a vector <serviceData>, with serviceData a structure defined in the header
@ -26,8 +26,8 @@ vector <serviceData> Services::readServicesFromCSV (const char *CSV) const
cout << "Invalid services.csv file." << endl; cout << "Invalid services.csv file." << endl;
}else{ }else{
string line; string line;
string tmpUserID; //used before converting to int
int userID; int userID;
string tmpUserID;
string username; string username;
string serveur; string serveur;
list <string> serveurs; list <string> serveurs;

View File

@ -22,10 +22,10 @@ class Services
//extracts the list of uid|username|service from the services.csv file //extracts the list of uid|username|service from the services.csv file
{ {
public: public:
Services(const char * servicesCSV="services.csv"); Services(string servicesCSV="../src/services.csv");
~Services(); ~Services();
private: private:
vector <serviceData> readServicesFromCSV (const char *CSV) const; vector <serviceData> readServicesFromCSV (string CSV) const;
vector <serviceData> services; vector <serviceData> services;
}; };

View File

@ -36,8 +36,7 @@ int main(int argc, char *argv[])
cout << "Invalid argument. \n" << endl; cout << "Invalid argument. \n" << endl;
exit(1); exit(1);
} }
Services myServices=Services("../src/services.csv");
Services myServices=Services("services.csv");
} }
return 0; return 0;