aboutsummaryrefslogtreecommitdiff
path: root/model.cpp
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-11 09:58:22 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-11 09:58:22 +0800
commit05f893bbe7e8a839c26cc951fafb166c25d0a6ee (patch)
tree26ede7d65a8baf4038fd97c297bb9cb7b5a7b7be /model.cpp
parent2729f71c327f8ef4ddbb620dc486e7334ba40119 (diff)
`apply` and `or` support
Diffstat (limited to 'model.cpp')
-rw-r--r--model.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/model.cpp b/model.cpp
index 7434690..cf38b13 100644
--- a/model.cpp
+++ b/model.cpp
@@ -258,6 +258,26 @@ StrObj *StrObj::from_string(string repr) {
return NULL;
}
+bool StrObj::lt(StrObj *r) {
+ return str < r->str;
+}
+
+bool StrObj::gt(StrObj *r) {
+ return str > r->str;
+}
+
+bool StrObj::le(StrObj *r) {
+ return str <= r->str;
+}
+
+bool StrObj::ge(StrObj *r) {
+ return str >= r->str;
+}
+
+bool StrObj::eq(StrObj *r) {
+ return str == r->str;
+}
+
BuiltinProcObj::BuiltinProcObj(BuiltinProc f, string _name) :
OptObj(), handler(f), name(_name) {}