Skip to content

Commit cd92829

Browse files
author
thk123
committed
Add spacing between function calls
1 parent 15234e1 commit cd92829

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/util/structured_data.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ labelt::labelt(std::vector<std::string> components) : components(components)
2222
});
2323
}));
2424
}
25+
2526
std::string labelt::camel_case() const
2627
{
2728
std::ostringstream output;
@@ -30,18 +31,21 @@ std::string labelt::camel_case() const
3031
output, std::next(components.begin()), components.end(), "", capitalize);
3132
return output.str();
3233
}
34+
3335
std::string labelt::snake_case() const
3436
{
3537
std::ostringstream output;
3638
join_strings(output, components.begin(), components.end(), '_');
3739
return output.str();
3840
}
41+
3942
std::string labelt::kebab_case() const
4043
{
4144
std::ostringstream output;
4245
join_strings(output, components.begin(), components.end(), '-');
4346
return output.str();
4447
}
48+
4549
std::string labelt::pretty() const
4650
{
4751
std::ostringstream output;
@@ -53,33 +57,40 @@ std::string labelt::pretty() const
5357
join_strings(output, range.begin(), range.end(), ' ');
5458
return output.str();
5559
}
60+
5661
bool labelt::operator<(const labelt &other) const
5762
{
5863
return components < other.components;
5964
}
65+
6066
structured_data_entryt structured_data_entryt::data_node(const jsont &data)
6167
{
6268
// Structured data (e.g. arrays and objects) should use an entry
6369
PRECONDITION(!(data.is_array() || data.is_object()));
6470
return structured_data_entryt(data);
6571
}
72+
6673
structured_data_entryt
6774
structured_data_entryt::entry(std::map<labelt, structured_data_entryt> children)
6875
{
6976
return structured_data_entryt(children);
7077
}
78+
7179
structured_data_entryt::structured_data_entryt(const jsont &data) : data(data)
7280
{
7381
}
82+
7483
structured_data_entryt::structured_data_entryt(
7584
std::map<labelt, structured_data_entryt> children)
7685
: _children(std::move(children))
7786
{
7887
}
88+
7989
bool structured_data_entryt::is_leaf() const
8090
{
8191
return _children.empty();
8292
}
93+
8394
std::string structured_data_entryt::leaf_data() const
8495
{
8596
return data.value;
@@ -89,10 +100,12 @@ structured_data_entryt::children() const
89100
{
90101
return _children;
91102
}
103+
92104
jsont structured_data_entryt::leaf_object() const
93105
{
94106
return data;
95107
}
108+
96109
structured_datat::structured_datat(
97110
std::map<labelt, structured_data_entryt> data)
98111
: _data(std::move(data))
@@ -153,6 +166,7 @@ std::string to_pretty(const structured_datat &data)
153166
join_strings(output, flattened_lines.begin(), flattened_lines.end(), "\n");
154167
return output.str();
155168
}
169+
156170
const std::map<labelt, structured_data_entryt> &structured_datat::data() const
157171
{
158172
return _data;

0 commit comments

Comments
 (0)