| 60 | } |
| 61 | |
| 62 | void PropertyManager::setProp(const std::string& key, const std::string& value) { |
| 63 | auto it = keyIndex.find(key); |
| 64 | if (it != keyIndex.end()) { |
| 65 | // Update existing |
| 66 | orderedProps[it->second].second = value; |
| 67 | } else { |
| 68 | // Append new |
| 69 | size_t idx = orderedProps.size(); |
| 70 | orderedProps.emplace_back(key, value); |
| 71 | keyIndex[key] = idx; |
| 72 | } |
| 73 | |
| 74 | saveToFile(); |
| 75 | } |
| 76 | |
| 77 | /* Optional implementations if needed later |
| 78 | bool PropertyManager::hasProp(const std::string& key) const { |