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
GCC = g++
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)
SRC = $(wildcard *.cpp)
EXE = deployer
BIN = ../bin
OBJETS_DIR = $(OBJETS:%=$(BIN)/%)
EXE_DIR = $(EXE:%=$(BIN)/%)
LIBRARIES =
$(EXE) : $(OBJETS)
$(EXE_DIR) : $(OBJETS_DIR)
$(ECHO) "-Linking $(EXE)-"
$(GCC) -o $@ $^ $(LIBRARIES)
%.o:%.cpp
$(BIN)/%.o:%.cpp
$(ECHO) "-Compilation $<- "
$(GCC) $(CCFLAGS) -o $@ $<

View File

@ -9,14 +9,14 @@
#include <string>
#include "Services.h"
Services::Services(const char *ServicesCSV)
Services::Services(string ServicesCSV)
{
services=readServicesFromCSV(ServicesCSV);
}
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
//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;
}else{
string line;
string tmpUserID; //used before converting to int
int userID;
string tmpUserID;
string username;
string serveur;
list <string> serveurs;

View File

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

View File

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