19 return !component.empty() &&
20 std::none_of(component.begin(), component.end(), ::isupper);
26 std::ostringstream output;
35 std::ostringstream output;
42 std::ostringstream output;
49 std::ostringstream output;
78 : data(std::move(data))
83 std::map<labelt, structured_data_entryt> children)
84 : _children(std::move(children))
97 const std::map<labelt, structured_data_entryt> &
109 std::map<labelt, structured_data_entryt> data)
110 : _data(std::move(data))
114 std::vector<std::string>
115 pretty_node(
const std::pair<labelt, structured_data_entryt> &entry)
117 const labelt &label = entry.first;
121 std::ostringstream line;
127 const auto indent = [](
const std::string &line) {
return "\t" + line; };
129 const auto &children = data.
children();
130 std::vector<std::vector<std::string>> lines =
133 .map([&](std::vector<std::string> sub_lines) {
136 .collect<std::vector<std::string>>();
138 .collect<std::vector<std::vector<std::string>>>();
140 std::vector<std::string> result;
141 for(
const auto &sub_lines : lines)
143 result.insert(result.end(), sub_lines.begin(), sub_lines.end());
151 if(data.
data().empty())
154 std::vector<std::vector<std::string>> lines =
157 .collect<std::vector<std::vector<std::string>>>();
158 std::vector<std::string> flattened_lines;
159 for(
const auto &line_section : lines)
161 flattened_lines.insert(
162 flattened_lines.end(), line_section.begin(), line_section.end());
164 std::ostringstream output;
165 join_strings(output, flattened_lines.begin(), flattened_lines.end(),
"\n");