15f1456fac
- Add regex search and replace - Add chunk iterator + update line iterator. - Cleanup/formatting.
36 lines
881 B
C++
36 lines
881 B
C++
#pragma once
|
|
|
|
#include "buffer/append.h"
|
|
#include "buffer/original.h"
|
|
#include "iterators/chunk.h"
|
|
#include "iterators/line.h"
|
|
#include "pch.h"
|
|
#include "search.h"
|
|
#include "shard.h"
|
|
|
|
struct Vase {
|
|
OriginalBuffer original;
|
|
AppendBuffer append;
|
|
|
|
/*std::vector<Shard *> undo; // TODO: later
|
|
uint8_t top; // of the undo stack.
|
|
uint8_t max; // for redo when no edits have been done after some undo.*/
|
|
|
|
Shard *root;
|
|
|
|
Vase(char *data, uint32_t length);
|
|
|
|
~Vase();
|
|
|
|
uint32_t length();
|
|
|
|
std::string to_string();
|
|
static void flatten(Shard *s, std::string &out);
|
|
|
|
void type(uint32_t offset, char key);
|
|
void insert(uint32_t offset, const char *data, uint32_t len);
|
|
void erase(uint32_t cursor, int64_t amount);
|
|
|
|
void regex_search_replace(std::string_view pattern, uint32_t start_offset, uint32_t end_offset, std::string_view replace, std::string_view options);
|
|
};
|