39 lines
829 B
C
39 lines
829 B
C
|
|
//
|
||
|
|
// Created by slinky on 5/14/26.
|
||
|
|
//
|
||
|
|
|
||
|
|
#ifndef B_ENGINE_ASSETREGISTRY_H
|
||
|
|
#define B_ENGINE_ASSETREGISTRY_H
|
||
|
|
|
||
|
|
#include <unordered_map>
|
||
|
|
#include <uuid/uuid.h>
|
||
|
|
#include <memory>
|
||
|
|
#include <vector>
|
||
|
|
#include <string_view>
|
||
|
|
#include <filesystem>
|
||
|
|
|
||
|
|
#include "AssetRecord.h"
|
||
|
|
|
||
|
|
#include "uuid.h"
|
||
|
|
|
||
|
|
namespace fs = std::filesystem;
|
||
|
|
|
||
|
|
using Directory = fs::recursive_directory_iterator;
|
||
|
|
using Path = fs::path;
|
||
|
|
|
||
|
|
class AssetRegistry {
|
||
|
|
public:
|
||
|
|
static void read_source_folder(std::string_view _folder);
|
||
|
|
|
||
|
|
static std::vector<AssetRegistry*> get_records();
|
||
|
|
static AssetRegistry* get_record(uuid_t uuid);
|
||
|
|
private:
|
||
|
|
static std::unordered_map<uuids::uuid, std::unique_ptr<AssetRegistry>> _registry;
|
||
|
|
|
||
|
|
static bool does_meta_exist(const Path& path);
|
||
|
|
static void generate_meta_file(const Path& path);
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
#endif //B_ENGINE_ASSETREGISTRY_H
|