mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 23:43:34 +00:00
1ac898ba00
* Remove GameConfig * Fully remove GmeConfig * Update worldconfig.ini Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
34 lines
645 B
C++
34 lines
645 B
C++
#pragma once
|
|
#include <fstream>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
class dConfig {
|
|
public:
|
|
dConfig(const std::string& filepath);
|
|
|
|
/**
|
|
* Gets the specified key from the config. Returns an empty string if the value is not found.
|
|
*
|
|
* @param key Key to find
|
|
* @return The keys value in the config
|
|
*/
|
|
const std::string& GetValue(std::string key);
|
|
|
|
/**
|
|
* Loads the config from a file
|
|
*/
|
|
void LoadConfig();
|
|
|
|
/**
|
|
* Reloads the config file to reset values
|
|
*/
|
|
void ReloadConfig();
|
|
private:
|
|
void ProcessLine(const std::string& line);
|
|
|
|
private:
|
|
std::map<std::string, std::string> m_ConfigValues;
|
|
std::string m_ConfigFilePath;
|
|
};
|