summaryrefslogtreecommitdiff
path: root/page.cpp
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-05-26 03:25:05 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-05-26 03:25:05 -0300
commit3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246 (patch)
tree8e0bef9529ea4802b06d5d95ad5c749c2662acaa /page.cpp
parent98280238383dc390207827d09dc92e0459229134 (diff)
downloadjet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.tar.gz
jet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.zip
Add partial support for utf-8
Diffstat (limited to 'page.cpp')
-rw-r--r--page.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/page.cpp b/page.cpp
index 7f56fc9..6ded950 100644
--- a/page.cpp
+++ b/page.cpp
@@ -58,14 +58,14 @@ struct Page {
dest->element_count = element_count;
}
- void operator++(int) {
+ void move_gap_forward() {
assert(gap_end < PAGE_SIZE);
elements[gap_start] = elements[gap_end];
gap_start++;
gap_end++;
}
- void operator--(int) {
+ void move_gap_backward() {
assert(gap_start > 0);
gap_end--;
gap_start--;
@@ -85,4 +85,12 @@ struct Page {
element_count--;
}
+ bool is_empty() {
+ return element_count == 0;
+ }
+
+ bool is_full() {
+ return gap_start == gap_end;
+ }
+
};