OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
packages.h
Go to the documentation of this file.
1// Loaded packages and cross-package object references. Spec: docs/formats/package.md (object references)
2#pragma once
3#include <map>
4#include <string>
5
6#include "upkg.h"
7#include "vfs.h"
8
9namespace ut {
10
11struct Object {
12 const Package* package = nullptr;
13 const Export* exp = nullptr;
14};
15
17public:
18 explicit PackageSet(const Vfs* vfs) : vfs_(vfs) {}
19 void add(const std::string& name, Package p); // for tests and preloaded maps
20 const Package* get(const std::string& name); // loads through the Vfs on first use; nullptr if not found
21 // Export behind an object reference of package `from`; imports are matched by name, class and group path.
22 Object resolve(const Package& from, int32_t ref);
23
24private:
25 const Vfs* vfs_;
26 std::map<std::string, Package> loaded_; // lower-case name
27};
28
29} // namespace ut
PackageSet(const Vfs *vfs)
Definition packages.h:18
Definition vfs.h:10
Definition collision.cpp:7
Definition upkg.h:32
Definition packages.h:11
const Export * exp
Definition packages.h:13
Definition upkg.h:39