diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-05-26 03:25:05 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-05-26 03:25:05 -0300 |
commit | 3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246 (patch) | |
tree | 8e0bef9529ea4802b06d5d95ad5c749c2662acaa /page.cpp | |
parent | 98280238383dc390207827d09dc92e0459229134 (diff) | |
download | jet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.tar.gz jet-3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246.zip |
Add partial support for utf-8
Diffstat (limited to 'page.cpp')
-rw-r--r-- | page.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; + } + }; |