Skip to content

Commit 077e545

Browse files
author
thk123
committed
Add spacing between function calls
1 parent 04611ad commit 077e545

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
@@ -16,6 +16,7 @@ labelt::labelt(std::vector<std::string> components) : components(components)
1616
});
1717
}));
1818
}
19+
1920
std::string labelt::camel_case() const
2021
{
2122
std::ostringstream output;
@@ -24,18 +25,21 @@ std::string labelt::camel_case() const
2425
output, std::next(components.begin()), components.end(), "", capitalize);
2526
return output.str();
2627
}
28+
2729
std::string labelt::snake_case() const
2830
{
2931
std::ostringstream output;
3032
join_strings(output, components.begin(), components.end(), '_');
3133
return output.str();
3234
}
35+
3336
std::string labelt::kebab_case() const
3437
{
3538
std::ostringstream output;
3639
join_strings(output, components.begin(), components.end(), '-');
3740
return output.str();
3841
}
42+
3943
std::string labelt::pretty() const
4044
{
4145
std::ostringstream output;
@@ -47,33 +51,40 @@ std::string labelt::pretty() const
4751
join_strings(output, range.begin(), range.end(), ' ');
4852
return output.str();
4953
}
54+
5055
bool labelt::operator<(const labelt &other) const
5156
{
5257
return components < other.components;
5358
}
59+
5460
structured_data_entryt structured_data_entryt::data_node(const jsont &data)
5561
{
5662
// Structured data (e.g. arrays and objects) should use an entry
5763
PRECONDITION(!(data.is_array() || data.is_object()));
5864
return structured_data_entryt(data);
5965
}
66+
6067
structured_data_entryt
6168
structured_data_entryt::entry(std::map<labelt, structured_data_entryt> children)
6269
{
6370
return structured_data_entryt(children);
6471
}
72+
6573
structured_data_entryt::structured_data_entryt(const jsont &data) : data(data)
6674
{
6775
}
76+
6877
structured_data_entryt::structured_data_entryt(
6978
std::map<labelt, structured_data_entryt> children)
7079
: _children(std::move(children))
7180
{
7281
}
82+
7383
bool structured_data_entryt::is_leaf() const
7484
{
7585
return _children.empty();
7686
}
87+
7788
std::string structured_data_entryt::leaf_data() const
7889
{
7990
return data.value;
@@ -83,10 +94,12 @@ structured_data_entryt::children() const
8394
{
8495
return _children;
8596
}
97+
8698
jsont structured_data_entryt::leaf_object() const
8799
{
88100
return data;
89101
}
102+
90103
structured_datat::structured_datat(
91104
std::map<labelt, structured_data_entryt> data)
92105
: _data(std::move(data))
@@ -147,6 +160,7 @@ std::string to_pretty(const structured_datat &data)
147160
join_strings(output, flattened_lines.begin(), flattened_lines.end(), "\n");
148161
return output.str();
149162
}
163+
150164
const std::map<labelt, structured_data_entryt> &structured_datat::data() const
151165
{
152166
return _data;

0 commit comments

Comments
 (0)