| 107 | } |
| 108 | |
| 109 | void PropertiesFile::insertAfter(const std::string& after_key, const std::string& key, const std::string& value) { |
| 110 | auto it = findKey(after_key); |
| 111 | if (it != lines_.end()) { |
| 112 | ++it; |
| 113 | lines_.emplace(it, key, value); |
| 114 | } else { |
| 115 | throw std::invalid_argument{"Key " + after_key + " not found in the config file!"}; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void PropertiesFile::append(const std::string& key, const std::string& value) { |
| 120 | lines_.emplace_back(key, value); |
no test coverage detected