summaryrefslogtreecommitdiffstats
path: root/src/ConfigReader/ConfigReader.cpp
blob: 7589d6a57fac0cb10ed23a07a73a8395644993b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 *  ConfigReader.cpp
 *
 *  Created on: 18.04.2016
 *      Author: Tobias Frust (t.frust@hzdr.de)
 */

#include <iostream>
#include <iomanip>
#include <cstdlib>

#include "ConfigReader.h"

ConfigReader::ConfigReader(const char* configFile) {
   try {
      cfg.readFile(configFile);
   } catch (const libconfig::FileIOException &fioex) {
      std::cerr << "I/O error while reading file." << std::endl;
      exit(1);
   } catch (const libconfig::ParseException &pex) {
      std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
            << " - " << pex.getError() << std::endl;
      exit(1);
   }
}