16#ifndef __ABG_INTERNED_STR_H__
17#define __ABG_INTERNED_STR_H__
23#include <unordered_set>
29using std::unordered_set;
113 {
return raw_ == o.raw_;}
169 {
return static_cast<string>(*this) <
static_cast<std::string
>(o);}
174 operator string()
const
185operator==(
const string& l,
const interned_string& r);
188operator!=(
const string& l,
const interned_string& r);
191operator<<(ostream& o,
const interned_string& s);
194operator+(
const interned_string& s1,
const string& s2);
197operator+(
const string& s1,
const interned_string& s2);
215 std::hash<size_t> hash_size_t;
216 return hash_size_t(
reinterpret_cast<size_t>(s.
raw()));
229 std::unique_ptr<priv> priv_;
The interned string pool.
bool has_string(const char *s) const
Test if the interned string pool already contains a string with a given value.
const char * get_string(const char *s) const
Get a pointer to the interned string which has a given value.
interned_string create_string(const std::string &)
Create an interned string with a given value.
interned_string_pool()
Default constructor.
~interned_string_pool()
Destructor.
The abstraction of an interned string.
bool operator<(const interned_string &o) const
"Less than" operator.
interned_string()
Default constructor.
const string * raw() const
Return the underlying pointer to std::string that this interned_string wraps.
bool operator==(const string &o) const
Compare the current instance of interned_string against an instance of std::string.
bool empty() const
Test if the current instance of interned_string is empty.
interned_string & operator=(const interned_string &o)
Assignment operator.
bool operator!=(const string &o) const
Inequality operator.
interned_string(const interned_string &o)
Copy constructor.
void clear()
Clear the string.
bool operator!=(const interned_string &o) const
Inequality operator.
bool operator==(const interned_string &o) const
Compare the current instance of interned_string against another instance of interned_string.
Toplevel namespace for libabigail.
bool operator==(const std::string &l, const interned_string &r)
Equality operator.
unordered_set< interned_string, hash_interned_string > interned_string_set_type
Convenience typedef for a set of interned_string.
std::string operator+(const interned_string &s1, const std::string &s2)
Concatenation operator.
std::ostream & operator<<(std::ostream &o, const interned_string &s)
Streaming operator.
A functor to hash instances of interned_string.
size_t operator()(const interned_string &s) const
The hash operator.