diff options
author | Gereon Kremer <gereon.kremer@cs.rwth-aachen.de> | 2020-12-15 20:09:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 20:09:54 +0100 |
commit | aa1b0e19f9ccfc5338a1d056f03b36c0bec6b4b4 (patch) | |
tree | 5ccfdbcd9ffcd0e741139d750d346c00fa9e884e /src/util/string.cpp | |
parent | 240dad8784b4c9743ff6153a18daa7ae388f03e3 (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.cpp | 10 |
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) |