From 3ae52c8cfdb1f8d6e887e9c8c980bbbec7fcb246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 26 May 2020 03:25:05 -0300 Subject: Add partial support for utf-8 --- page.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'page.cpp') 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; + } + }; -- cgit v1.2.3