@@ -33,36 +33,37 @@ void ebmc_baset::show_properties()
33
33
{
34
34
unsigned p_nr=1 ;
35
35
36
+ auto make_xml =
37
+ [](const ebmc_propertiest::propertyt &p, std::size_t p_nr) -> xmlt {
38
+ xmlt xml (" property" );
39
+ xml.set_attribute (" name" , id2string (p.name ));
40
+
41
+ xml.new_element (" number" ).data = std::to_string (p_nr); // will go away
42
+ xml.new_element (" description" ).data = p.description ;
43
+
44
+ if (p.location .is_not_nil ())
45
+ xml.new_element (" location" ) = ::xml (p.location );
46
+
47
+ return xml;
48
+ };
49
+
36
50
for (const auto &p : properties.properties )
37
51
{
38
- switch (static_cast <ui_message_handlert &>(message.get_message_handler ()).get_ui ()) {
52
+ switch (static_cast <ui_message_handlert &>(message.get_message_handler ())
53
+ .get_ui ())
54
+ {
39
55
case ui_message_handlert::uit::XML_UI:
40
- {
41
- xmlt xml (" property" );
42
- xml.set_attribute (" name" , id2string (p.name ));
43
-
44
- xml.new_element (" number" ).data =std::to_string (p_nr); // will go away
45
- xml.new_element (" expression" ).data =p.expr_string ;
46
- xml.new_element (" description" ).data =p.description ;
47
-
48
- if (p.location .is_not_nil ())
49
- xml.new_element (" location" )=::xml (p.location );
50
-
51
- std::cout << xml << ' \n ' ;
52
- }
56
+ std::cout << make_xml (p, p_nr) << ' \n ' ;
53
57
break ;
54
58
55
59
case ui_message_handlert::uit::PLAIN:
56
- std::cout << p.name << " : " ;
57
- std::cout << p.expr_string ;
58
- if (!p.description .empty ())
59
- std::cout << " (" << p.description << " )" ;
60
- std::cout << ' \n ' ;
60
+ std::cout << p.name << " : " << p.description << ' \n ' ;
61
61
break ;
62
+
62
63
case ui_message_handlert::uit::JSON_UI:
63
64
default :;
64
65
}
65
-
66
+
66
67
p_nr++;
67
68
}
68
69
}
0 commit comments