Major updates:
- A lotta cleanup - BEd command parser rewrite - Vase class removed - Proper IO system. - A lot more.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
#include "storage.h"
|
||||
|
||||
namespace bed::internal::vase {
|
||||
struct OriginalStorage : Storage {
|
||||
std::atomic_uint64_t refs{0};
|
||||
const char *buf = nullptr;
|
||||
uint64_t len = 0;
|
||||
int fd = -1;
|
||||
|
||||
OriginalStorage(std::filesystem::path base_dir);
|
||||
~OriginalStorage();
|
||||
|
||||
void initialize();
|
||||
const char *read(uint64_t pos) override;
|
||||
uint64_t length() override;
|
||||
|
||||
void retain() override {
|
||||
refs++;
|
||||
}
|
||||
|
||||
void release() override {
|
||||
if (--refs > 0)
|
||||
return;
|
||||
delete this;
|
||||
}
|
||||
};
|
||||
} // namespace bed::internal::vase
|
||||
Reference in New Issue
Block a user