summaryrefslogtreecommitdiff
path: root/src/util/string.cpp
diff options
context:
space:
mode:
authorGereon Kremer <gereon.kremer@cs.rwth-aachen.de>2020-12-15 20:09:54 +0100
committerGitHub <noreply@github.com>2020-12-15 20:09:54 +0100
commitaa1b0e19f9ccfc5338a1d056f03b36c0bec6b4b4 (patch)
tree5ccfdbcd9ffcd0e741139d750d346c00fa9e884e /src/util/string.cpp
parent240dad8784b4c9743ff6153a18daa7ae388f03e3 (diff)
Add getters to retrieve constants from api::Term (#5677)
This PR adds method to obtain constant values from api::Term that are either integers or strings.
Diffstat (limited to 'src/util/string.cpp')
-rw-r--r--src/util/string.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/string.cpp b/src/util/string.cpp
index 0d40ebb05..e625c2199 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -291,6 +291,16 @@ std::string String::toString(bool useEscSequences) const {
return str.str();
}
+std::wstring String::toWString() const
+{
+ std::wstring res(size(), static_cast<wchar_t>(0));
+ for (std::size_t i = 0; i < size(); ++i)
+ {
+ res[i] = static_cast<wchar_t>(d_str[i]);
+ }
+ return res;
+}
+
bool String::isLeq(const String &y) const
{
for (unsigned i = 0; i < size(); ++i)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback