Skip to content
Snippets Groups Projects
Commit 1ac6cf16 authored by Lais Frigério's avatar Lais Frigério
Browse files

Including datasid .h file

parent 8c9644ec
No related branches found
No related tags found
2 merge requests!51Merge development to master,!32Issue/10
Pipeline #
/* Copyright (C) 2004-2016 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This file is part of datasid
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#pragma once
#include <iostream>
class Agent{
private:
std::string confDir;
std::string defaultConf;
std::string logFile;
std::string prefix;
std::string version;
public:
void setConfDir(std::string);
void setDefaultConf(std::string);
void setLogFile(std::string, std::string);
void setPrefix(std::string, int);
void setVersion(std::string);
std::string getConfDir() const;
std::string getDefaultConf() const;
std::string getLogFile() const;
std::string getPrefix() const;
std::string getVersion() const;
};
int datasid_agent();
std::string getAbsolutePath( std::string str, int tot);
bool prefixIsSet(std::string prefix);
/* Copyright (C) 2004-2016 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This file is part of datasid
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#pragma once
#include <sys/stat.h>
#include "datasid-agent.h"
#include "datasid-conf.h"
#include "datasid-proxy.h"
bool datasid_common(Conf* conf, Proxy* proxy, Agent* agent);
bool fileExist(const char * file);
/* Copyright (C) 2004-2016 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This file is part of datasid
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#pragma once
#include <map>
#include "datasid-agent.h"
#include "datasid-parse.h"
class Conf{
private:
std::string dataDir;
std::string logDir;
std::string proxyConf;
std::string webService;
int delay;
int daysToExpireLog;
int updateTries;
int updateTimeOut;
public:
void setDataDir(std::string);
void setLogDir(std::string);
void setProxyConf(std::string);
void setWebService(std::string);
void setDelay(int);
void setDaysToExpireLog(int);
void setUpdateTries(int);
void setUpdatTimeOut(int);
std::string getDataDir() const;
std::string getLogDir() const;
std::string getProxyConf() const;
std::string getWebService() const;
int getDelay() const;
int getDaysToExpireLog() const;
int getUpdateTries() const;
int getUpdateTimeOut() const;
};
void datasid_conf(Agent* agent, Conf* conf);
bool setConf(Conf* conf, Agent* agent, std::map<std::string, std::string>* content);
/* Copyright (C) 2004-2016 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This file is part of datasid
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#pragma once
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <locale>
#include <map>
bool isValid(std::string * line);
void normalize(std::string * str);
void parse(std::string * line, std::map<std::string, std::string> * content);
bool readFile(const std::string file, std::map<std::string, std::string> * content);
bool spaceOnly(const std::string * line);
void trim(std::string& str);
/* Copyright (C) 2004-2016 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This file is part of datasid
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#pragma once
#include <map>
#include "datasid-agent.h"
#include "datasid-conf.h"
#include "datasid-parse.h"
class Proxy{
private:
std::string host;
std::string port;
std::string user;
std::string password;
public:
void setHost(std::string);
void setPort(std::string);
void setUser(std::string);
void setPassword(std::string);
std::string getHost() const;
std::string getPort() const;
std::string getUser() const;
std::string getPassword() const;
};
void datasid_proxy(Conf* conf, Proxy* proxy);
bool setProxy(Proxy* proxy, std::map<std::string, std::string>* content);
#ifndef __main__
#define __main__
#include <cstring>
#include <fstream>
#include <iostream>
#include "linux/datasid-proxy.h"
#include "linux/datasid-common.h"
#include "linux/datasid-agent.h"
#include "linux/datasid-conf.h"
bool fileExist(const std::string& file);
int main();
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment