Skip to content

Commit 5550c08

Browse files
author
thk123
committed
Made the json and xml show functions class use operator()
1 parent 4f54e00 commit 5550c08

5 files changed

+16
-16
lines changed

src/goto-programs/show_goto_functions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ void show_goto_functions(
4545
case ui_message_handlert::XML_UI:
4646
{
4747
show_goto_functions_xmlt xml_show_functions(ns);
48-
xml_show_functions.print_goto_functions(goto_functions, std::cout);
48+
xml_show_functions(goto_functions, std::cout);
4949
}
5050
break;
5151

5252
case ui_message_handlert::JSON_UI:
5353
{
5454
show_goto_functions_jsont json_show_functions(ns);
55-
json_show_functions.print_goto_functions(goto_functions, std::cout);
55+
json_show_functions(goto_functions, std::cout);
5656
}
5757
break;
5858

src/goto-programs/show_goto_functions_json.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ show_goto_functions_jsont::show_goto_functions_jsont(const namespacet &ns):
3939

4040
/*******************************************************************\
4141
42-
Function: show_goto_functions_jsont::show_goto_functions
42+
Function: show_goto_functions_jsont::convert
4343
4444
Inputs:
4545
goto_functions - the goto functions that make up the program
@@ -51,7 +51,7 @@ Function: show_goto_functions_jsont::show_goto_functions
5151
5252
\*******************************************************************/
5353

54-
json_objectt show_goto_functions_jsont::get_goto_functions(
54+
json_objectt show_goto_functions_jsont::convert(
5555
const goto_functionst &goto_functions)
5656
{
5757
json_arrayt json_functions;
@@ -131,7 +131,7 @@ json_objectt show_goto_functions_jsont::get_goto_functions(
131131

132132
/*******************************************************************\
133133
134-
Function: show_goto_functions_jsont::print_goto_functions
134+
Function: show_goto_functions_jsont::operator()
135135
136136
Inputs:
137137
goto_functions - the goto functions that make up the program
@@ -147,7 +147,7 @@ Function: show_goto_functions_jsont::print_goto_functions
147147
148148
\*******************************************************************/
149149

150-
void show_goto_functions_jsont::print_goto_functions(
150+
void show_goto_functions_jsont::operator()(
151151
const goto_functionst &goto_functions,
152152
std::ostream &out,
153153
bool append)
@@ -156,5 +156,5 @@ void show_goto_functions_jsont::print_goto_functions(
156156
{
157157
out << ",\n";
158158
}
159-
out << get_goto_functions(goto_functions);
159+
out << convert(goto_functions);
160160
}

src/goto-programs/show_goto_functions_json.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class show_goto_functions_jsont
1919
public:
2020
explicit show_goto_functions_jsont(const namespacet &ns);
2121

22-
json_objectt get_goto_functions(const goto_functionst &goto_functions);
23-
void print_goto_functions(
22+
json_objectt convert(const goto_functionst &goto_functions);
23+
void operator()(
2424
const goto_functionst &goto_functions, std::ostream &out, bool append=true);
2525

2626
private:

src/goto-programs/show_goto_functions_xml.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ show_goto_functions_xmlt::show_goto_functions_xmlt(const namespacet &ns):
4040

4141
/*******************************************************************\
4242
43-
Function: show_goto_functions_xmlt::show_goto_functions
43+
Function: show_goto_functions_xmlt::convert
4444
4545
Inputs:
4646
goto_functions - the goto functions that make up the program
@@ -66,7 +66,7 @@ Function: show_goto_functions_xmlt::show_goto_functions
6666
6767
\*******************************************************************/
6868

69-
xmlt show_goto_functions_xmlt::get_goto_functions(
69+
xmlt show_goto_functions_xmlt::convert(
7070
const goto_functionst &goto_functions)
7171
{
7272
xmlt xml_functions=xmlt("functions");
@@ -116,7 +116,7 @@ xmlt show_goto_functions_xmlt::get_goto_functions(
116116

117117
/*******************************************************************\
118118
119-
Function: show_goto_functions_xmlt::print_goto_functions
119+
Function: show_goto_functions_xmlt::operator()
120120
121121
Inputs:
122122
goto_functions - the goto functions that make up the program
@@ -132,7 +132,7 @@ Function: show_goto_functions_xmlt::print_goto_functions
132132
133133
\*******************************************************************/
134134

135-
void show_goto_functions_xmlt::print_goto_functions(
135+
void show_goto_functions_xmlt::operator()(
136136
const goto_functionst &goto_functions,
137137
std::ostream &out,
138138
bool append)
@@ -141,5 +141,5 @@ void show_goto_functions_xmlt::print_goto_functions(
141141
{
142142
out << "\n";
143143
}
144-
out << get_goto_functions(goto_functions);
144+
out << convert(goto_functions);
145145
}

src/goto-programs/show_goto_functions_xml.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class show_goto_functions_xmlt
1919
public:
2020
explicit show_goto_functions_xmlt(const namespacet &ns);
2121

22-
xmlt get_goto_functions(const goto_functionst &goto_functions);
23-
void print_goto_functions(
22+
xmlt convert(const goto_functionst &goto_functions);
23+
void operator()(
2424
const goto_functionst &goto_functions, std::ostream &out, bool append=true);
2525

2626
private:

0 commit comments

Comments
 (0)