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

Method Line

libminifi/src/properties/PropertiesFile.cpp:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace minifi {
29
30PropertiesFile::Line::Line(std::string line) : line_(line) {
31 line = utils::StringUtils::trim(line);
32 if (line.empty() || line[0] == '#') { return; }
33
34 size_t index_of_first_equals_sign = line.find('=');
35 if (index_of_first_equals_sign == std::string::npos) { return; }
36
37 std::string key = utils::StringUtils::trim(line.substr(0, index_of_first_equals_sign));
38 if (key.empty()) { return; }
39
40 key_ = key;
41 value_ = utils::StringUtils::trim(line.substr(index_of_first_equals_sign + 1));
42}
43
44PropertiesFile::Line::Line(std::string key, std::string value)
45 : line_{utils::StringUtils::join_pack(key, "=", value)}, key_{std::move(key)}, value_{std::move(value)} {

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected