File tree 2 files changed +38
-0
lines changed 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Author: Daniel Kroening, Peter Schrammel
12
12
#include " properties.h"
13
13
14
14
#include < util/invariant.h>
15
+ #include < util/json.h>
16
+ #include < util/xml.h>
15
17
16
18
std::string as_string (resultt result)
17
19
{
@@ -89,6 +91,31 @@ propertiest initialize_properties(const abstract_goto_modelt &goto_model)
89
91
return properties;
90
92
}
91
93
94
+ std::string
95
+ as_string (const irep_idt &property_id, const property_infot &property_info)
96
+ {
97
+ return " [" + id2string (property_id) + " ] " + property_info.description +
98
+ " : " + as_string (property_info.status );
99
+ }
100
+
101
+ xmlt xml (const irep_idt &property_id, const property_infot &property_info)
102
+ {
103
+ xmlt xml_result (" result" );
104
+ xml_result.set_attribute (" property" , id2string (property_id));
105
+ xml_result.set_attribute (" status" , as_string (property_info.status ));
106
+ return xml_result;
107
+ }
108
+
109
+ json_objectt
110
+ json (const irep_idt &property_id, const property_infot &property_info)
111
+ {
112
+ json_objectt result;
113
+ result[" property" ] = json_stringt (property_id);
114
+ result[" description" ] = json_stringt (property_info.description );
115
+ result[" status" ] = json_stringt (as_string (property_info.status ));
116
+ return result;
117
+ }
118
+
92
119
std::size_t
93
120
count_properties (const propertiest &properties, property_statust status)
94
121
{
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Author: Daniel Kroening, Peter Schrammel
16
16
17
17
#include < goto-programs/goto_model.h>
18
18
19
+ class json_objectt ;
20
+ class xmlt ;
21
+
19
22
// / The status of a property
20
23
enum class property_statust
21
24
{
@@ -73,6 +76,14 @@ typedef std::unordered_map<irep_idt, property_infot> propertiest;
73
76
// / Returns the properties in the goto model
74
77
propertiest initialize_properties (const abstract_goto_modelt &);
75
78
79
+ std::string
80
+ as_string (const irep_idt &property_id, const property_infot &property_info);
81
+
82
+ xmlt xml (const irep_idt &property_id, const property_infot &property_info);
83
+
84
+ json_objectt
85
+ json (const irep_idt &property_id, const property_infot &property_info);
86
+
76
87
// / Return the number of properties with given \p status
77
88
std::size_t count_properties (const propertiest &, property_statust);
78
89
You can’t perform that action at this time.
0 commit comments