上传文件至 'source-code/source/plugins/TLAC/FileSystem'
New function added "GetStringValue" to get string value from the config file
This commit is contained in:
@@ -47,6 +47,14 @@ namespace TLAC::FileSystem
|
||||
return found ? (float)atof(pair->second.c_str()) : 0.0f;
|
||||
}
|
||||
|
||||
std::string ConfigFile::GetStringValue(const std::string& key)
|
||||
{
|
||||
auto pair = ConfigMap.find(key);
|
||||
bool found = pair != ConfigMap.end();
|
||||
|
||||
return found ? pair->second : "";
|
||||
}
|
||||
|
||||
void ConfigFile::Parse(std::ifstream &fileStream)
|
||||
{
|
||||
std::string line;
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace TLAC::FileSystem
|
||||
int GetIntegerValue(const std::string& key);
|
||||
bool GetBooleanValue(const std::string& key);
|
||||
float GetFloatValue(const std::string& key);
|
||||
std::string GetStringValue(const std::string& key);
|
||||
|
||||
protected:
|
||||
virtual void Parse(std::ifstream &fileStream) override;
|
||||
|
||||
Reference in New Issue
Block a user