Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Archive.hh
1
#pragma once
2
3
#include <
Common.hh
>
4
5
#include <abstract/Archive.hh>
6
#include <abstract/memory/List.hh>
7
8
namespace
Host
{
9
10
class
Context;
11
12
}
// namespace Host
13
14
namespace
Abstract::Memory {
15
16
struct
MEMList;
17
18
}
// namespace Abstract::Memory
19
21
namespace
EGG
{
22
23
class
Archive
:
Disposer
{
24
friend
class
Host::Context
;
25
26
public
:
27
~Archive
();
28
29
void
unmount();
30
[[nodiscard]]
s32
convertPathToEntryId(
const
char
*path)
const
;
31
void
*getFileFast(
s32
entryId,
Abstract::ArchiveHandle::FileInfo
&info)
const
;
32
33
[[nodiscard]]
static
Archive
*
FindArchive
(
void
*archiveStart);
34
[[nodiscard]]
static
Archive
*
Mount
(
void
*archiveStart);
35
36
private
:
37
Archive
(
void
*archiveStart);
38
39
[[nodiscard]]
static
constexpr
uintptr_t GetLinkOffset() {
40
// offsetof doesn't work, so instead of hardcoding an offset, we derive it ourselves
41
return
reinterpret_cast<
uintptr_t
>
(&
reinterpret_cast<
Archive
*
>
(NULL)->m_link);
42
}
43
44
Abstract::ArchiveHandle
m_handle;
45
s32
m_refCount = 1;
46
Abstract::Memory::MEMLink
m_link;
47
48
static
Abstract::Memory::MEMList
s_archiveList
;
49
};
50
51
}
// namespace EGG
Common.hh
This header houses common data types such as our integral types and enums.
Abstract::ArchiveHandle
Definition
Archive.hh:11
EGG::Archive
Definition
Archive.hh:23
EGG::Archive::s_archiveList
static Abstract::Memory::MEMList s_archiveList
The linked list of all mounted archives.
Definition
Archive.hh:48
EGG::Archive::FindArchive
static Archive * FindArchive(void *archiveStart)
Checks to see if a given archive is already mounted.
Definition
Archive.cc:37
EGG::Archive::~Archive
~Archive()
Removes the archive from the static list.
Definition
Archive.cc:11
EGG::Archive::Mount
static Archive * Mount(void *archiveStart)
Creates a new Archive object or increments the ref count for an already existing Archive.
Definition
Archive.cc:53
EGG::Disposer
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition
Disposer.hh:11
Host::Context
Contexts can be used to restore a previous memory state for the current session.
Definition
Context.hh:59
int32_t
EGG
EGG core library.
Definition
Archive.cc:6
Host
Represents the host application.
Definition
HeapCommon.hh:9
Abstract::ArchiveHandle::FileInfo
Definition
Archive.hh:50
Abstract::Memory::MEMLink
Link of an instrusive doubly-linked list.
Definition
List.hh:8
Abstract::Memory::MEMList
Intrusive doubly-linked list. Links are placed within the corresponding object.
Definition
List.hh:14
egg
core
Archive.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.12.0