36 lines
1013 B
C++
36 lines
1013 B
C++
#include "ConfigManager.hpp"
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include "yaml.hpp"
|
|
|
|
namespace Plains {
|
|
namespace Core {
|
|
|
|
using std::string;
|
|
|
|
ConfigManager::ConfigManager(vector<string>& parameters) :
|
|
_logger(Logger::getInstance()),
|
|
_parameters(parameters)
|
|
{
|
|
// move this to a function that can return an error code?
|
|
if ( parameters.size() == 0 ) return;
|
|
_logger.debug.ln ("[Core:ConfigManager] Loading Configuration...");
|
|
|
|
/*
|
|
for (unsigned i = 0; i < (numParameters-1); ++i) {
|
|
string p = string(parameters[i]);
|
|
string v = string(parameters[i+1]);
|
|
// Check if this parameter is an argument or an argument value:
|
|
if ( p.compare(0,1,"-") == 0 ) {
|
|
_logger.debug("[Core:ConfigManager] Interpreting parameter " << p);
|
|
if ( ! p.compare("--initial-peer") ) _logger.debug("[Core:ConfigManager] Peer " << v << " set");
|
|
}
|
|
}
|
|
*/
|
|
|
|
_logger.debug.ln ("[Core:ConfigManager] Configuration successfully parsed");
|
|
}
|
|
|
|
|
|
}}
|