summaryrefslogtreecommitdiff
path: root/src/util/regexp.h
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-09 13:35:59 -0500
committerGitHub <noreply@github.com>2020-03-09 13:35:59 -0500
commit9f77ec44decf18fe23c738988281373795dcca0d (patch)
tree9772a0ae0bc73e3e00c8b716468b8a86b332f2c6 /src/util/regexp.h
parentc1da31ed532cd1767c20d5fc01df893c427e0e8e (diff)
Convert more uses of strings to words (#3921)
Towards theory of sequences. Also adds documentation to strncmp/rstrncmp and adds them to the Word interface.
Diffstat (limited to 'src/util/regexp.h')
-rw-r--r--src/util/regexp.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/util/regexp.h b/src/util/regexp.h
index 1cde53687..731736f72 100644
--- a/src/util/regexp.h
+++ b/src/util/regexp.h
@@ -109,8 +109,18 @@ class CVC4_PUBLIC String {
bool operator<=(const String& y) const { return cmp(y) <= 0; }
bool operator>=(const String& y) const { return cmp(y) >= 0; }
- bool strncmp(const String& y, const std::size_t np) const;
- bool rstrncmp(const String& y, const std::size_t np) const;
+ /**
+ * Returns true if this string is equal to y for their first n characters.
+ * If n is larger than the length of this string or y, this method returns
+ * true if and only if this string is equal to y.
+ */
+ bool strncmp(const String& y, std::size_t n) const;
+ /**
+ * Returns true if this string is equal to y for their last n characters.
+ * Similar to strncmp, if n is larger than the length of this string or y,
+ * this method returns true if and only if this string is equal to y.
+ */
+ bool rstrncmp(const String& y, std::size_t n) const;
/* toString
* Converts this string to a std::string.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback