@@ -46,13 +46,14 @@ optionalt<source_locationt> find_property(
4646 return { };
4747}
4848
49-
5049void show_properties (
5150 const namespacet &ns,
5251 const irep_idt &identifier,
52+ message_handlert &message_handler,
5353 ui_message_handlert::uit ui,
5454 const goto_programt &goto_program)
5555{
56+ messaget msg (message_handler);
5657 for (const auto &ins : goto_program.instructions )
5758 {
5859 if (!ins.is_assert ())
@@ -83,7 +84,7 @@ void show_properties(
8384 xml_property.new_element (" expression" ).data =
8485 from_expr (ns, identifier, ins.guard );
8586
86- std::cout << xml_property << ' \n ' ;
87+ msg. result () << xml_property;
8788 }
8889 break ;
8990
@@ -92,14 +93,13 @@ void show_properties(
9293 break ;
9394
9495 case ui_message_handlert::uit::PLAIN:
95- std::cout << " Property " << property_id << " :\n " ;
96+ msg. result () << " Property " << property_id << " :\n " ;
9697
97- std::cout << " " << ins.source_location << ' \n '
98- << " " << description << ' \n '
99- << " " << from_expr (ns, identifier, ins.guard )
100- << ' \n ' ;
98+ msg.result () << " " << ins.source_location << ' \n '
99+ << " " << description << ' \n '
100+ << " " << from_expr (ns, identifier, ins.guard ) << ' \n ' ;
101101
102- std::cout << ' \n ' ;
102+ msg. result () << messaget::eom ;
103103 break ;
104104
105105 default :
@@ -147,8 +147,10 @@ void show_properties_json(
147147
148148void show_properties_json (
149149 const namespacet &ns,
150+ message_handlert &message_handler,
150151 const goto_functionst &goto_functions)
151152{
153+ messaget msg (message_handler);
152154 json_arrayt json_properties;
153155
154156 for (const auto &fct : goto_functions.function_map )
@@ -161,29 +163,31 @@ void show_properties_json(
161163
162164 json_objectt json_result;
163165 json_result[" properties" ] = json_properties;
164- std::cout << " , \n " << json_result;
166+ msg. result () << json_result;
165167}
166168
167169void show_properties (
168170 const namespacet &ns,
171+ message_handlert &message_handler,
169172 ui_message_handlert::uit ui,
170173 const goto_functionst &goto_functions)
171174{
172175 if (ui == ui_message_handlert::uit::JSON_UI)
173- show_properties_json (ns, goto_functions);
176+ show_properties_json (ns, message_handler, goto_functions);
174177 else
175178 for (const auto &fct : goto_functions.function_map )
176179 if (!fct.second .is_inlined ())
177- show_properties (ns, fct.first , ui, fct.second .body );
180+ show_properties (ns, fct.first , message_handler, ui, fct.second .body );
178181}
179182
180183void show_properties (
181184 const goto_modelt &goto_model,
185+ message_handlert &message_handler,
182186 ui_message_handlert::uit ui)
183187{
184188 const namespacet ns (goto_model.symbol_table );
185189 if (ui == ui_message_handlert::uit::JSON_UI)
186- show_properties_json (ns, goto_model.goto_functions );
190+ show_properties_json (ns, message_handler, goto_model.goto_functions );
187191 else
188- show_properties (ns, ui, goto_model.goto_functions );
192+ show_properties (ns, message_handler, ui, goto_model.goto_functions );
189193}
0 commit comments