[nostalgia/core] Update TypeStore::loadDescriptor to take type version
This commit is contained in:
@ -3,3 +3,16 @@
|
||||
*/
|
||||
|
||||
#include "typestore.hpp"
|
||||
|
||||
namespace nostalgia::core {
|
||||
|
||||
ox::Result<ox::UniquePtr<ox::DescriptorType>> TypeStore::loadDescriptor(const ox::String &name, int version) noexcept {
|
||||
constexpr auto descPath = "/.nostalgia/type_descriptors";
|
||||
auto path = ox::sfmt("{}/{};{}", descPath, name, version);
|
||||
oxRequire(buff, m_fs->read(path));
|
||||
auto dt = ox::make_unique<ox::DescriptorType>();
|
||||
oxReturnError(ox::readClaw<ox::DescriptorType>(buff, dt.get()));
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
@ -20,14 +20,7 @@ class TypeStore: public ox::TypeStore {
|
||||
}
|
||||
|
||||
protected:
|
||||
ox::Result<ox::UniquePtr<ox::DescriptorType>> loadDescriptor(const ox::String &name) noexcept override {
|
||||
constexpr auto descPath = "/.nostalgia/type_descriptors";
|
||||
auto path = ox::sfmt("{}/{}", descPath, name);
|
||||
oxRequire(buff, m_fs->read(path));
|
||||
auto dt = ox::make_unique<ox::DescriptorType>();
|
||||
oxReturnError(ox::readClaw<ox::DescriptorType>(buff, dt.get()));
|
||||
return dt;
|
||||
}
|
||||
ox::Result<ox::UniquePtr<ox::DescriptorType>> loadDescriptor(const ox::String &name, int version) noexcept override;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user