Skip to content

Commit d64c5a2

Browse files
committed
Print dbus_array objects enclosed by '[]' instead of '{}'.
Print dbus_struct objects enclosed by '{}' instead of '()'. Print dbus_dict_entry objects enclosed by '()' instead of '[]'.
1 parent d9d8770 commit d64c5a2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/ultrabus/dbus_array.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017,2021 Dan Arrhenius <dan@ultramarin.se>
2+
* Copyright (C) 2017,2021,2023 Dan Arrhenius <dan@ultramarin.se>
33
*
44
* This file is part of libultrabus.
55
*
@@ -393,13 +393,13 @@ namespace ultrabus {
393393
const std::string dbus_array::str () const
394394
{
395395
std::stringstream ss;
396-
ss << '{';
396+
ss << '[';
397397
for (auto i=elements.begin(); i!=elements.end();) {
398398
ss << (*i)->str ();
399399
if (++i != elements.end())
400400
ss << ',';
401401
}
402-
ss << '}';
402+
ss << ']';
403403
return ss.str ();
404404
}
405405

src/ultrabus/dbus_dict_entry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017,2021 Dan Arrhenius <dan@ultramarin.se>
2+
* Copyright (C) 2017,2021,2023 Dan Arrhenius <dan@ultramarin.se>
33
*
44
* This file is part of libultrabus.
55
*
@@ -237,7 +237,7 @@ namespace ultrabus {
237237
const std::string dbus_dict_entry::str () const
238238
{
239239
std::stringstream ss;
240-
ss << '[' << dict_key->str() << ',' << dict_value->str() << ']';
240+
ss << '(' << dict_key->str() << ',' << dict_value->str() << ')';
241241
return ss.str ();
242242
}
243243

src/ultrabus/dbus_struct.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017,2021 Dan Arrhenius <dan@ultramarin.se>
2+
* Copyright (C) 2017,2021,2023 Dan Arrhenius <dan@ultramarin.se>
33
*
44
* This file is part of libultrabus.
55
*
@@ -183,13 +183,13 @@ namespace ultrabus {
183183
const std::string dbus_struct::str () const
184184
{
185185
std::stringstream ss;
186-
ss << '(';
186+
ss << '{';
187187
for (auto i=elements.begin(); i!=elements.end();) {
188188
ss << (*i)->str ();
189189
if (++i != elements.end())
190190
ss << ',';
191191
}
192-
ss << ')';
192+
ss << '}';
193193
return ss.str ();
194194
}
195195

0 commit comments

Comments
 (0)