CBMC
|
dstringt has one field, an unsigned integer no which is an index into a static table of strings. More...
#include <dstring.h>
Public Member Functions | |
dstringt () | |
dstringt (const char *s) | |
dstringt (const std::string &s) | |
dstringt (const dstringt &)=default | |
dstringt (dstringt &&other) | |
Move constructor. More... | |
bool | empty () const |
bool | starts_with (const char *s) const |
equivalent of as_string().starts_with(s) More... | |
bool | starts_with (const std::string &prefix) const |
equivalent of as_string().starts_with(s) More... | |
char | operator[] (size_t i) const |
const char * | c_str () const |
size_t | size () const |
bool | operator< (const dstringt &b) const |
bool | operator== (const dstringt &b) const |
bool | operator!= (const dstringt &b) const |
bool | operator== (const char *b) const |
bool | operator!= (const char *b) const |
bool | operator== (const std::string &b) const |
bool | operator!= (const std::string &b) const |
bool | operator< (const std::string &b) const |
bool | operator> (const std::string &b) const |
bool | operator<= (const std::string &b) const |
bool | operator>= (const std::string &b) const |
int | compare (const dstringt &b) const |
void | clear () |
void | swap (dstringt &b) |
dstringt & | operator= (const dstringt &b) |
dstringt & | operator= (dstringt &&other) |
Move assignment. More... | |
std::ostream & | operator<< (std::ostream &out) const |
unsigned | get_no () const |
size_t | hash () const |
std::string::const_iterator | begin () const |
std::string::const_iterator | end () const |
Static Public Member Functions | |
static dstringt | make_from_table_index (unsigned no) |
Private Member Functions | |
dstringt (unsigned _no) | |
const std::string & | as_string () const |
Private Attributes | |
unsigned | no |
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
This makes it expensive to create a new string(because you have to look through the whole table to see if it is already there, and add it if it isn't) but very cheap to compare strings (just compare the two integers). It also means that when you have lots of copies of the same string you only have to store the whole string once, which saves space.
irep_idt
is typedef-ed to dstringt in irep.h.
Note: Marked final to disable inheritance. No virtual destructor, so runtime-polymorphic use would be unsafe.
|
default |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::ostream & dstringt::operator<< | ( | std::ostream & | out | ) | const |
Definition at line 16 of file dstring.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
equivalent of as_string().starts_with(s)
|
inline |
equivalent of as_string().starts_with(s)