MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / writeTo

Method writeTo

libminifi/src/properties/PropertiesFile.cpp:134–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void 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
147PropertiesFile::Lines::const_iterator PropertiesFile::begin() const {
148 return lines_.begin();

Calls 1

getLineMethod · 0.80

Tested by

no test coverage detected