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

Method insertAfter

libminifi/src/properties/PropertiesFile.cpp:109–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void 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
119void PropertiesFile::append(const std::string& key, const std::string& value) {
120 lines_.emplace_back(key, value);

Callers 2

Calls 2

endMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected