mirror of
https://github.com/Z3Prover/z3
synced 2025-06-24 06:43:40 +00:00
remove symbol -> zstring -> symbol round-trips
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5cb0bac41d
commit
20a67e47ca
13 changed files with 68 additions and 62 deletions
|
@ -19,21 +19,23 @@ Author:
|
|||
#include <string>
|
||||
#include "util/vector.h"
|
||||
#include "util/buffer.h"
|
||||
#include "util/rational.h"
|
||||
|
||||
class zstring {
|
||||
private:
|
||||
buffer<unsigned> m_buffer;
|
||||
bool well_formed() const;
|
||||
bool uses_unicode() const;
|
||||
bool is_escape_char(bool from_input, char const *& s, unsigned& result);
|
||||
bool is_escape_char(char const *& s, unsigned& result);
|
||||
public:
|
||||
static unsigned unicode_max_char() { return 196607; }
|
||||
static unsigned unicode_num_bits() { return 18; }
|
||||
static unsigned ascii_max_char() { return 255; }
|
||||
static unsigned ascii_num_bits() { return 8; }
|
||||
zstring() {}
|
||||
zstring(char const* s, bool from_input);
|
||||
zstring(const std::string &str) : zstring(str.c_str(), false) {}
|
||||
zstring(char const* s);
|
||||
zstring(const std::string &str) : zstring(str.c_str()) {}
|
||||
zstring(rational const& r): zstring(r.to_string()) {}
|
||||
zstring(unsigned sz, unsigned const* s) { m_buffer.append(sz, s); SASSERT(well_formed()); }
|
||||
zstring(unsigned ch);
|
||||
zstring replace(zstring const& src, zstring const& dst) const;
|
||||
|
@ -51,6 +53,7 @@ public:
|
|||
zstring operator+(zstring const& other) const;
|
||||
bool operator==(const zstring& other) const;
|
||||
bool operator!=(const zstring& other) const;
|
||||
unsigned hash() const;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream &os, const zstring &str);
|
||||
friend bool operator<(const zstring& lhs, const zstring& rhs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue