3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-12-21 03:33:43 +00:00

add get_lstring per #2286

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-05-22 10:16:15 +04:00
parent 112e13eeea
commit b2845d888e
11 changed files with 64 additions and 10 deletions

View file

@ -224,6 +224,17 @@ std::string zstring::encode() const {
return strm.str();
}
std::string zstring::as_string() const {
SASSERT(m_encoding == ascii);
std::ostringstream strm;
for (unsigned i = 0; i < m_buffer.size(); ++i) {
unsigned char ch = m_buffer[i];
strm << (char)(ch);
}
return strm.str();
}
bool zstring::suffixof(zstring const& other) const {
if (length() > other.length()) return false;
bool suffix = true;