mirror of https://github.com/YosysHQ/yosys.git
Add IdString::ends_with()
This commit is contained in:
parent
66b5f5166b
commit
3ea0161ae7
|
@ -222,6 +222,12 @@ namespace RTLIL
|
||||||
return std::string(c_str() + pos, len);
|
return std::string(c_str() + pos, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ends_with(const char* suffix) const {
|
||||||
|
size_t len = strlen(suffix);
|
||||||
|
if (size() < len) return false;
|
||||||
|
return substr(size()-len) == suffix;
|
||||||
|
}
|
||||||
|
|
||||||
size_t size() const {
|
size_t size() const {
|
||||||
return str().size();
|
return str().size();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue