| 6 | #include <vector> |
| 7 | |
| 8 | class PropertyManager { |
| 9 | public: |
| 10 | explicit PropertyManager(std::string path); |
| 11 | |
| 12 | std::string getProp(const std::string& key, const std::string& defaultValue = ""); |
| 13 | void setProp(const std::string& key, const std::string& value); |
| 14 | // bool hasProp(const std::string& key) const; |
| 15 | // void removeProp(const std::string& key); |
| 16 | |
| 17 | private: |
| 18 | std::string filePath; |
| 19 | |
| 20 | // Maintain insertion order |
| 21 | std::vector<std::pair<std::string, std::string>> orderedProps; |
| 22 | |
| 23 | // Fast lookup: key -> index in orderedProps |
| 24 | std::unordered_map<std::string, size_t> keyIndex; |
| 25 | |
| 26 | bool loadFromFile(); |
| 27 | bool saveToFile(); |
| 28 | }; |
| 29 | |
| 30 | #endif //NOHELLO_PROPERTYMANAGER_H |
nothing calls this directly
no outgoing calls
no test coverage detected