aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.h
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-14 12:25:06 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-14 12:25:06 -0700
commita48b5bfaa5c55bfe4e5ff859b453ee00a1dd68c6 (patch)
treeb394f54f4af7d7cab0b987b70645a46f9d67a905 /kernel/rtlil.h
parent97d265637505a239e3d328a3ee7e26c6fd5d6744 (diff)
downloadyosys-a48b5bfaa5c55bfe4e5ff859b453ee00a1dd68c6.tar.gz
yosys-a48b5bfaa5c55bfe4e5ff859b453ee00a1dd68c6.tar.bz2
yosys-a48b5bfaa5c55bfe4e5ff859b453ee00a1dd68c6.zip
Further cleanup based on @daveshah1
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r--kernel/rtlil.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index d3ad57d72..f4fcf5dcf 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -276,6 +276,12 @@ namespace RTLIL
return std::string(c_str() + pos, len);
}
+ bool begins_with(const char* prefix) const {
+ size_t len = strlen(prefix);
+ if (size() < len) return false;
+ return substr(0, len) == prefix;
+ }
+
bool ends_with(const char* suffix) const {
size_t len = strlen(suffix);
if (size() < len) return false;