projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
66b5f51
)
Add IdString::ends_with()
author
Eddie Hung
<eddieh@ece.ubc.ca>
Tue, 26 Feb 2019 20:04:16 +0000
(12:04 -0800)
committer
Eddie Hung
<eddieh@ece.ubc.ca>
Tue, 26 Feb 2019 20:04:16 +0000
(12:04 -0800)
kernel/rtlil.h
patch
|
blob
|
history
diff --git
a/kernel/rtlil.h
b/kernel/rtlil.h
index f877622aa4f781e20cc21a6ef4ce36adb3a36f31..eb71fec7b63eca9e43f83c166cbfc60c97c00f15 100644
(file)
--- a/
kernel/rtlil.h
+++ b/
kernel/rtlil.h
@@
-222,6
+222,12
@@
namespace RTLIL
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 {
return str().size();
}