Major changes to api and structure.
- Remove newline caching - limit petal sizes - make public facing api use points only - fix iterators (chunk & line)
This commit is contained in:
@@ -8,11 +8,14 @@ struct ChunkIterator {
|
||||
std::vector<Shard *> stack;
|
||||
Petal *petal = nullptr;
|
||||
uint32_t petal_offset = 0;
|
||||
uint32_t global_offset;
|
||||
|
||||
ChunkIterator(Shard *r, uint32_t offset = 0);
|
||||
ChunkIterator(Shard *r);
|
||||
|
||||
~ChunkIterator();
|
||||
|
||||
void seek(uint32_t offset);
|
||||
void seek_offset(uint32_t offset);
|
||||
void seek_line(uint32_t offset);
|
||||
bool next(const char **data, uint32_t *out_len);
|
||||
uint32_t byte_offset();
|
||||
};
|
||||
|
||||
@@ -5,16 +5,17 @@
|
||||
#include "pch.h"
|
||||
|
||||
struct LineIterator {
|
||||
uint32_t offset;
|
||||
ChunkIterator it;
|
||||
|
||||
const char *cursor = nullptr;
|
||||
uint32_t remaining = 0;
|
||||
bool eof = false;
|
||||
uint32_t remaining = 0;
|
||||
uint32_t line_offset = 0;
|
||||
|
||||
LineIterator(Shard *r, uint32_t start_line);
|
||||
|
||||
~LineIterator();
|
||||
~LineIterator() = default;
|
||||
|
||||
bool next(std::string &line);
|
||||
uint32_t byte_offset();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user