12 #ifndef CPROVER_UTIL_DSTRING_H
13 #define CPROVER_UTIL_DSTRING_H
60 constexpr
operator int()
const {
return no; }
97 for(
const char *t =
c_str(); *s != 0; s++, t++)
107 return as_string().compare(0, prefix.size(), prefix) == 0;
166 {
no=b.
no;
return *
this; }
178 std::ostream &
operator<<(std::ostream &out)
const;
193 std::string::const_iterator
begin()
const
198 std::string::const_iterator
end()
const
235 return a.operator<<(out);
247 return dstring.
hash();
265 template <
typename T>
267 typename std::enable_if<std::is_integral<T>::value,
dstringt>::type
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool operator!=(const char *b) const
bool operator<(const dstringt &b) const
dstringt(const std::string &s)
dstringt & operator=(dstringt &&other)
Move assignment.
bool starts_with(const char *s) const
equivalent of as_string().starts_with(s)
bool operator!=(const std::string &b) const
bool starts_with(const std::string &prefix) const
equivalent of as_string().starts_with(s)
dstringt(const dstringt &)=default
bool operator<(const std::string &b) const
bool operator<=(const std::string &b) const
static dstringt make_from_table_index(unsigned no)
bool operator==(const char *b) const
const char * c_str() const
bool operator!=(const dstringt &b) const
int compare(const dstringt &b) const
std::string::const_iterator end() const
std::ostream & operator<<(std::ostream &out) const
bool operator==(const dstringt &b) const
const std::string & as_string() const
std::string::const_iterator begin() const
dstringt(dstringt &&other)
Move constructor.
char operator[](size_t i) const
bool operator==(const std::string &b) const
bool operator>=(const std::string &b) const
dstringt & operator=(const dstringt &b)
bool operator>(const std::string &b) const
const std::string & get_string(size_t no) const
size_t hash_string(const dstringt &s)
const std::string & as_string(const dstringt &s)
dstringt get_dstring_number(std::size_t)
static std::enable_if< std::is_integral< T >::value, dstringt >::type to_dstring(T value)
equivalent to dstringt(std::to_string(value)), i.e., produces a string from a number
std::ostream & operator<<(std::ostream &out, const dstringt &a)
Magic numbers used throughout the codebase.
constexpr std::size_t DSTRING_NUMBERS_MAX
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
string_containert & get_string_container()
Get a reference to the global string container.
static std::string diagnostics_as_string(const dstringt &dstring)
Helper to give us some diagnostic in a usable form on assertion failure.
size_t operator()(const dstringt &s) const
size_t operator()(const dstringt &dstring) const