Add clipboard buffer.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "decl.h"
|
||||
#include "pch.h"
|
||||
|
||||
namespace bed::internal::buffer {
|
||||
struct GenericBuffer : Buffer {
|
||||
vase::Shard *root;
|
||||
std::filesystem::path save_path{};
|
||||
std::string language{};
|
||||
std::optional<syntax::Parser> parser{};
|
||||
|
||||
GenericBuffer(std::string name)
|
||||
: Buffer(name, Kind::Generic), root(nullptr) {};
|
||||
~GenericBuffer();
|
||||
|
||||
bool waste() override;
|
||||
uint64_t lines() override;
|
||||
uint64_t bytes() override;
|
||||
void load(BEd &ctx) override;
|
||||
void load(BEd &ctx, vase::Shard *text) override;
|
||||
void load(BEd &ctx, const char *cmd) override;
|
||||
void load(BEd &ctx, std::filesystem::path path) override;
|
||||
vase::Shard *copy(uint64_t start_line, uint64_t end_line) override;
|
||||
void substitute(
|
||||
BEd &ctx, uint64_t start_line, uint64_t end_line,
|
||||
std::string ®ex, std::string &replacement, std::string &options
|
||||
) override;
|
||||
void join(BEd &ctx, uint64_t start_line, uint64_t end_line) override;
|
||||
void remove(BEd &ctx, uint64_t start_line, uint64_t end_line) override;
|
||||
void append(BEd &ctx, vase::Shard *text, uint64_t line) override;
|
||||
void print(BEd &ctx, uint64_t start_line, uint64_t end_line) override;
|
||||
void number_print(BEd &ctx, uint64_t start_line, uint64_t end_line) override;
|
||||
uint64_t next_closing(uint64_t start) override;
|
||||
uint64_t prev_closing(uint64_t start) override;
|
||||
uint64_t find_next(std::string_view pattern, uint64_t start) override;
|
||||
uint64_t find_prev(std::string_view pattern, uint64_t start) override;
|
||||
};
|
||||
} // namespace bed::internal::buffer
|
||||
Reference in New Issue
Block a user