sh8s_deployer/test/ServicesTest/Services.h

31 lines
758 B
C++

// deployer Services header
// Copyright (C) 2024 Jean-Cloud
// GNU General Public License v3
#if !defined(SERVICES_H)
#define SERVICES_H
#include <iostream>
#include <cstring>
#include <list>
#include <vector>
#include "Service.h"
using namespace std;
class Services
//extracts the list of uid|username|service from the services.csv file
{
public:
Services(string servicesCSV="../src/services.csv");
vector<Service> getServices() const;
const Service * findByUsername(string aUsername) const;
const Service * findByID(int aUserID) const;
list<const Service*> findByServer(string aServer) const;
~Services();
private:
vector <Service> readServicesFromCSV (string CSV) const;
vector <Service> services;
};
#endif