hathor-cpp-scanner/config.hh

51 lines
800 B
C++

#ifndef HATHOR_CONFIG_H
#define HATHOR_CONFIG_H
#endif
#include <iostream>
#include <fstream>
#include <cstring>
#include "3rdparty/json/src/json.hpp"
// JSON
using nlohmann::json;
// String
using std::string;
using std::cout;
using std::endl;
using std::ifstream;
using std::stringstream;
// Errors
using std::exception;
using std::domain_error;
using std::invalid_argument;
struct scanner_config {
struct {
string host;
string db;
short port;
string user;
string pass;
} mysql;
struct {
string path;
short throttle;
} scanner;
struct {
string root;
string user;
string pass;
string email;
} php;
};
string getFileExtension(std::string fn);
json parse_file(const std::string &filename);
scanner_config hathor_config(json &j_JSON);