5 #include <unordered_map>
15 using std::unordered_map;
24 void Properties::load(
const string& pathName,
const string& fileName,
FileSystemInterface* fileSystem)
28 if (fileSystem ==
nullptr) fileSystem = FileSystem::getInstance();
30 for (
auto i = 0; i < lines.size(); i++) {
33 auto separatorPos = line.find(
'=');
34 if (separatorPos == -1)
continue;
42 vector<string> result;
45 result.push_back(key +
"=" + value);
47 sort(result.begin(), result.end());
48 if (fileSystem ==
nullptr) fileSystem = FileSystem::getInstance();
File system singleton class.
Properties class, which helps out with storeing or loading key value pairs from/to property files.
unordered_map< string, string > properties
void store(const string &pathName, const string &fileName, FileSystemInterface *fileSystem=nullptr) const
Store property file.
virtual void setContentFromStringArray(const string &pathName, const string &fileName, const vector< string > &content)=0
Set file content as string array.
virtual void getContentAsStringArray(const string &pathName, const string &fileName, vector< string > &content)=0
Get file content as string array.