83 Literal (
const char* literal) noexcept
91 operator const char* ()
const {
return str_; }
92 const char* c()
const {
return str_; }
97 return !str_ || 0 == std::strlen(str_);
125 Symbol (
const char* lit =NULL)
126 :
Symbol{std::string(lit? lit : BOTTOM.c())}
130 Symbol (std::string&& definition);
132 Symbol (std::string
const& str)
133 :
Symbol{std::string(str)}
137 :
Symbol{std::string(base)+
"."+ext}
141 :
Symbol{base, std::string(ext)}
150 explicit operator bool()
const {
return not empty(); }
151 bool empty()
const {
return *
this == BOTTOM; }
156 return std::strlen(c());
183 inline bool operator== (
const char* s1,
Literal s2) {
return s2.operator== (s1); }
184 inline bool operator== (
Symbol s1,
const char* s2) {
return s1.operator== (s2); }
185 inline bool operator== (
const char* s1,
Symbol s2) {
return s2.operator== (s1); }
188 inline bool operator== (
Literal s1, std::string s2) {
return s1.operator== (s2.c_str()); }
189 inline bool operator== (std::string s1,
Literal s2) {
return s2.operator== (s1.c_str()); }
190 inline bool operator== (
Symbol s1, std::string s2) {
return s1.operator== (s2.c_str()); }
191 inline bool operator== (std::string s1,
Symbol s2) {
return s2.operator== (s1.c_str()); }
195 inline bool operator!= (
Literal const& s1,
Literal const& s2) {
return not s1.operator== (s2.c()); }
196 inline bool operator!= (
Symbol const& s1,
Symbol const& s2) {
return not (s1.c() == s2.c()); }
197 inline bool operator!= (
Literal s1,
const char* s2) {
return not s1.operator== (s2); }
198 inline bool operator!= (
const char* s1,
Literal s2) {
return not s2.operator== (s1); }
199 inline bool operator!= (
Symbol s1,
const char* s2) {
return not s1.operator== (s2); }
200 inline bool operator!= (
const char* s1,
Symbol s2) {
return not s2.operator== (s1); }
201 inline bool operator!= (
Literal s1,
Symbol s2) {
return not s1.operator== (s2.c()); }
202 inline bool operator!= (
Symbol s1,
Literal s2) {
return not s2.operator== (s1.c()); }
203 inline bool operator!= (
Literal s1, std::string s2) {
return not s1.operator== (s2.c_str()); }
204 inline bool operator!= (std::string s1,
Literal s2) {
return not s2.operator== (s1.c_str()); }
205 inline bool operator!= (
Symbol s1, std::string s2) {
return not s1.operator== (s2.c_str()); }
206 inline bool operator!= (std::string s1,
Symbol s2) {
return not s2.operator== (s1.c_str()); }
214 const char* symP (sym);
221 const char* symP (sym);
inline string literal This is a marker type to indicate that
const size_t STRING_MAX_RELEVANT
safety guard: maximum number of chars to process.
Implementation namespace for support and library code.
std::string operator+(std::string str, Literal const &sym)
string concatenation
Token or Atom with distinct identity.
bool operator==(const char *cString) const
equality on Literal and Symbol values is defined based on the content, not the address.
Helper to use a single extension point for specialised hash functions.
Literal() noexcept
empty string by default
HashVal hash_value(QueryText const &entry)
support using queries in hashtables.
Literal & operator=(const char *newStr) noexcept
Assignment generally prohibited.