mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 08:58:04 +00:00
format codebase
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "GameConfig.h"
|
||||
#include <sstream>
|
||||
|
||||
std::map<std::string, std::string> GameConfig::m_Config {};
|
||||
std::string GameConfig::m_EmptyString {};
|
||||
std::map<std::string, std::string> GameConfig::m_Config{};
|
||||
std::string GameConfig::m_EmptyString{};
|
||||
|
||||
void GameConfig::Load(const std::string& filepath) {
|
||||
m_EmptyString = "";
|
||||
@@ -15,7 +15,7 @@ void GameConfig::Load(const std::string& filepath) {
|
||||
if (line[0] != '#') ProcessLine(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& GameConfig::GetValue(const std::string& key) {
|
||||
const auto& it = m_Config.find(key);
|
||||
@@ -37,14 +37,14 @@ void GameConfig::ProcessLine(const std::string& line) {
|
||||
std::vector<std::string> seglist;
|
||||
|
||||
while (std::getline(ss, segment, '=')) {
|
||||
seglist.push_back(segment);
|
||||
seglist.push_back(segment);
|
||||
}
|
||||
|
||||
if (seglist.size() != 2) return;
|
||||
|
||||
//Make sure that on Linux, we remove special characters:
|
||||
if (!seglist[1].empty() && seglist[1][seglist[1].size() - 1] == '\r')
|
||||
seglist[1].erase(seglist[1].size() - 1);
|
||||
seglist[1].erase(seglist[1].size() - 1);
|
||||
|
||||
m_Config.insert_or_assign(seglist[0], seglist[1]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user