Reqrite project as BEd specific.

This commit is contained in:
2026-08-13 16:17:32 +01:00
parent cc5d475ab8
commit cd13557e15
46 changed files with 1115 additions and 1026 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
AppendBuffer::AppendBuffer(std::filesystem::path base_dir) {
base_dir /= "tapp.XXXXXX";
char *s = strdup(base_dir.c_str());
@@ -69,4 +69,4 @@ const char *AppendBuffer::read(uint64_t pos) {
uint64_t AppendBuffer::length() {
return current_size;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
OriginalBuffer::OriginalBuffer(std::filesystem::path base_dir) {
if (!std::filesystem::exists(base_dir) || !std::filesystem::is_directory(base_dir))
throw std::runtime_error("Swap directory does not exist or is not a directory.");
@@ -44,4 +44,4 @@ const char *OriginalBuffer::read(uint64_t pos) {
uint64_t OriginalBuffer::length() {
return len;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
LineIterator::LineIterator(Shard *root, uint64_t line_num, Direction dir)
: it(root, dir), dir(dir) {
it.seek_line(line_num);
@@ -72,4 +72,4 @@ bool LineIterator::next(std::string *line) {
uint64_t LineIterator::byte_offset() {
return last_line_offset;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
PetalIterator::PetalIterator(Shard *r, Direction dir)
: dir(dir), root(r) {
if (!root)
@@ -168,4 +168,4 @@ bool PetalIterator::next(const char **data, uint64_t *out_len) {
uint64_t PetalIterator::byte_offset() {
return last_offset;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
std::vector<Vase::ReplacePart> Vase::parse_replace(std::string_view s) {
std::vector<ReplacePart> parts;
std::string constant;
@@ -156,4 +156,4 @@ std::vector<Range> Vase::regex_search(
result.push_back({point_of(match.start), point_of(match.end)});
return result;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
std::vector<Vase::RegexMatch> Vase::_regex_search(
std::string_view pattern, Range range, std::string_view options
) {
@@ -244,4 +244,4 @@ std::vector<Vase::RegexMatch> Vase::_regex_search(
return results;
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
void Shard::retain(Shard *n) {
if (n)
n->refs++;
@@ -424,4 +424,4 @@ void Shard::dump(Shard *node, int depth) {
<< "\"\n";
}
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase
+2 -2
View File
@@ -1,6 +1,6 @@
#include "internal/vase/vase.h"
namespace crib::internal::vase {
namespace bed::internal::vase {
Vase::Vase(std::filesystem::path path, std::filesystem::path swapdir)
: path(path), swapdir(swapdir) {
if (!std::filesystem::exists(swapdir) || !std::filesystem::is_directory(swapdir))
@@ -507,4 +507,4 @@ void Vase::move_lines(Point *point, uint64_t amount, Direction dir) {
}
clamp(point);
}
} // namespace crib::internal::vase
} // namespace bed::internal::vase