| 132 | } |
| 133 | |
| 134 | void PropertiesFile::writeTo(const std::string& file_path) const { |
| 135 | try { |
| 136 | std::ofstream file{file_path}; |
| 137 | file.exceptions(std::ios::failbit | std::ios::badbit); |
| 138 | |
| 139 | for (const auto& line : lines_) { |
| 140 | file << line.getLine() << '\n'; |
| 141 | } |
| 142 | } catch (const std::exception&) { |
| 143 | throw std::runtime_error{"Could not write to file " + file_path}; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | PropertiesFile::Lines::const_iterator PropertiesFile::begin() const { |
| 148 | return lines_.begin(); |
no test coverage detected