feat: start to add preloader v1.13.0 support.
This commit is contained in:
21
src/data_format/_pl/v1_13_0/blob_impl.h
Normal file
21
src/data_format/_pl/v1_13_0/blob_impl.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "data_format/magic_blob.h"
|
||||
|
||||
namespace di::data_format::_pl::v1_13_0 {
|
||||
|
||||
class MagicBlobImpl : public MagicBlob {
|
||||
public:
|
||||
using for_each_callback_t =
|
||||
std::function<void(hash_t, shared_entry_t const&)>;
|
||||
|
||||
void read(const fs::path& path) override;
|
||||
|
||||
shared_entry_t query(std::string_view symbol) const override;
|
||||
|
||||
void for_each(const for_each_callback_t& callback) const override;
|
||||
|
||||
size_t count() const override;
|
||||
};
|
||||
|
||||
} // namespace di::data_format::_pl::v1_13_0
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "data_format/magic_blob.h"
|
||||
|
||||
#include "data_format/_pl/v1_12_0/blob_impl.h"
|
||||
#include "data_format/_pl/v1_13_0/blob_impl.h"
|
||||
|
||||
namespace di::data_format {
|
||||
|
||||
@@ -8,6 +9,8 @@ MagicBlob::blob_t MagicBlob::create(FormatVersion version) {
|
||||
switch (version) {
|
||||
case V1_12_0:
|
||||
return std::make_unique<_pl::v1_12_0::MagicBlobImpl>();
|
||||
case V1_13_0:
|
||||
return std::make_unique<_pl::v1_13_0::MagicBlobImpl>();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ class MagicBlob : public io::StreamedIO {
|
||||
public:
|
||||
enum FormatVersion {
|
||||
V1_12_0,
|
||||
V1_13_0,
|
||||
};
|
||||
|
||||
using blob_t = std::unique_ptr<MagicBlob>;
|
||||
|
||||
Reference in New Issue
Block a user