|
12345678910111213141516171819202122232425262728 |
- #pragma once
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <array>
- #include <map>
- #include <easylogging++.h>
- #include <memory>
-
- class SystemConfig
- {
- public:
- void readStandardConfig();
- SystemConfig();
- static int getIntConfigParameter(std::string paramName);
- static float getFloatConfigParameter(std::string paramName);
- static std::string getStringConfigParameter(std::string paramName);
- private:
- //Parameters to read from the file (name and default value)
- static std::map<std::string, int> intParameter;
- static std::map<std::string, float> floatParameter;
- static std::map<std::string, std::string> stringParameter;
-
- const std::string filePath = "system_conf.conf";
- std::string fileContent;
- void parseConfFile();
- friend std::ostream& operator<<(std::ostream& os, SystemConfig& config);
- };
|