5 #include <unordered_map>
14 using std::unordered_map;
22 void Properties::load(
const string& pathName,
const string& fileName)
26 FileSystem::getContentAsStringArray(pathName, fileName, lines);
27 for (
auto i = 0; i < lines.size(); i++) {
30 auto separatorPos = line.find(
'=');
31 if (separatorPos == -1)
continue;
39 vector<string> result;
42 result.push_back(key +
"=" + value);
44 sort(result.begin(), result.end());
45 FileSystem::setContentFromStringArray(pathName, fileName, result);
Properties class, which helps out with storeing or loading key value pairs from/to property files.
void store(const string &pathName, const string &fileName) const
Store property file.
unordered_map< string, string > properties