Skip to content

Commit cc0d810

Browse files
committed
string_constantt: C++ style accessors
This adds C++ style (as opposed to Java style) accessors to string_constantt.
1 parent 169648f commit cc0d810

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/util/string_constant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ static array_typet make_type(const irep_idt &value)
2121
string_constantt::string_constantt(const irep_idt &_value)
2222
: nullary_exprt(ID_string_constant, make_type(_value))
2323
{
24-
set_value(_value);
24+
value(_value);
2525
}
2626

27-
void string_constantt::set_value(const irep_idt &_value)
27+
void string_constantt::value(const irep_idt &_value)
2828
{
2929
exprt::type() = make_type(_value);
3030
set(ID_value, _value);

src/util/string_constant.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@ class string_constantt : public nullary_exprt
1616
public:
1717
explicit string_constantt(const irep_idt &);
1818

19-
void set_value(const irep_idt &);
19+
DEPRECATED(SINCE(2023, 10, 31, "use value(...)"))
20+
void set_value(const irep_idt &_value)
21+
{
22+
value(_value);
23+
}
24+
25+
void value(const irep_idt &);
2026

27+
DEPRECATED(SINCE(2023, 10, 31, "use value()"))
2128
const irep_idt &get_value() const
29+
{
30+
return value();
31+
}
32+
33+
const irep_idt &value() const
2234
{
2335
return get(ID_value);
2436
}

0 commit comments

Comments
 (0)