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
9
namespace
ut
{
10
11
struct
Object
{
12
const
Package
*
package
= nullptr;
13
const
Export
*
exp
=
nullptr
;
14
};
15
16
class
PackageSet
{
17
public
:
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
24
private
:
25
const
Vfs
* vfs_;
26
std::map<std::string, Package> loaded_;
// lower-case name
27
};
28
29
}
// namespace ut
ut::PackageSet::PackageSet
PackageSet(const Vfs *vfs)
Definition
packages.h:18
ut::Vfs
Definition
vfs.h:10
ut
Definition
collision.cpp:7
ut::Export
Definition
upkg.h:32
ut::Object
Definition
packages.h:11
ut::Object::exp
const Export * exp
Definition
packages.h:13
ut::Package
Definition
upkg.h:39
upkg.h
vfs.h
engine
packages.h
Generated by
1.16.1