Major refractor

- Add regex search and replace
- Add chunk iterator + update line iterator.
- Cleanup/formatting.
This commit is contained in:
2026-07-29 04:50:22 +01:00
parent d8a59a5f5c
commit 15f1456fac
16 changed files with 759 additions and 256 deletions
+18
View File
@@ -0,0 +1,18 @@
#pragma once
#include "../shard.h"
#include "pch.h"
struct ChunkIterator {
Shard *root = nullptr;
std::vector<Shard *> stack;
Petal *petal = nullptr;
uint32_t petal_offset = 0;
ChunkIterator(Shard *r, uint32_t offset = 0);
~ChunkIterator();
void seek(uint32_t offset);
bool next(const char **data, uint32_t *out_len);
};
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include "../shard.h"
#include "chunk.h"
#include "pch.h"
struct LineIterator {
uint32_t offset;
ChunkIterator it;
const char *cursor = nullptr;
uint32_t remaining = 0;
bool eof = false;
LineIterator(Shard *r, uint32_t start_line);
~LineIterator();
bool next(std::string &line);
};