avec dossiers
This commit is contained in:
parent
e2a37fae16
commit
d81176ffa6
BIN
Services.o
BIN
Services.o
Binary file not shown.
BIN
bin/deployer
Executable file
BIN
bin/deployer
Executable file
Binary file not shown.
@ -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 $@ $<
|
||||
|
@ -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;
|
@ -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;
|
||||
|
||||
};
|
@ -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;
|
Loading…
Reference in New Issue
Block a user