summaryrefslogtreecommitdiff
path: root/src/storage.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-11 21:14:25 -0400
committerbd <bdunahu@operationnull.com>2025-04-11 21:14:25 -0400
commit101f0facf8002907ca6e19faabfdcf472c0c3152 (patch)
treef5cdc59276f18428a02db3898be6ccf23753c349 /src/storage.cc
parent1b5a73c67f9eaaf73e5046f52c48105579a7dae4 (diff)
Move source files to top-level src directory
Diffstat (limited to 'src/storage.cc')
-rw-r--r--src/storage.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/storage.cc b/src/storage.cc
new file mode 100644
index 0000000..fed607b
--- /dev/null
+++ b/src/storage.cc
@@ -0,0 +1,16 @@
+#include "storage.h"
+#include "definitions.h"
+#include <algorithm>
+
+std::vector<std::array<signed int, LINE_SIZE>>
+Storage::view(int base, int lines) const
+{
+ base = (base / LINE_SIZE) * LINE_SIZE;
+ std::vector<std::array<signed int, LINE_SIZE>> ret(lines + 1);
+ std::copy(
+ this->data->begin() + base, this->data->begin() + base + lines,
+ ret.begin());
+ return ret;
+}
+
+Storage *Storage::get_lower() { return this->lower; }