wavelength 1.0.0
Loading...
Searching...
No Matches
ArkHash Class Reference

Hash table of the names of the files and directories of an archive. More...

#include <arkhash.h>

Public Member Functions

 ArkHash ()
 Construct an empty table.
int GetHashValue (const char *pszName) const
 Find the slot of a name, probing the following slots in turn.
void Read (BinStream &stream)
 Replace the table with the one a stream stores.
 ArkHash ()
 Create an empty table.
 ~ArkHash ()
 Free the strings and the table.
int GetHashValue (const char *str)
 Find a string.
void Read (BinStream &stream)
 Replace the strings and the table with the ones a stream stores.

Public Attributes

char * mHeap
char * mHeapEnd
char * mFree

Detailed Description

Hash table of the names of the files and directories of an archive.

Open-addressed hash table of the archive's file and directory names.

The class is not polymorphic and emits no RTTI. The name is taken from the tag of its allocations. The stream stores the offset of each name in the string block, which Read() converts in place to a pointer into mStrings. Zero marks an empty slot.

The object is 0x14 bytes. The class name comes from the allocation name ArkHash.

Constructor & Destructor Documentation

◆ ArkHash() [1/2]

ArkHash::ArkHash ( )

Construct an empty table.

Ghidra address:
NTSC-U/C: 0x0028df60
Ghidra address:
PAL: 0x00297940

◆ ArkHash() [2/2]

ArkHash::ArkHash ( )

Create an empty table.

Ghidra address:
0x1000d380

◆ ~ArkHash()

ArkHash::~ArkHash ( )

Free the strings and the table.

Ghidra address:
0x1000d3a0

Member Function Documentation

◆ GetHashValue() [1/2]

int ArkHash::GetHashValue ( const char * pszName) const

Find the slot of a name, probing the following slots in turn.

Parameters
pszNameThe name.
Returns
The slot, or -1 when the name is absent.
Ghidra address:
NTSC-U/C: 0x0028df80
Ghidra address:
PAL: 0x00297960

◆ Read() [1/2]

void ArkHash::Read ( BinStream & stream)

Replace the table with the one a stream stores.

Parameters
streamThe stream.
Ghidra address:
NTSC-U/C: 0x0028e038
Ghidra address:
PAL: 0x00297a18

◆ GetHashValue() [2/2]

int ArkHash::GetHashValue ( const char * str)

Find a string.

Parameters
strThe string.
Returns
The string's slot, or -1 when the table does not have it.
Ghidra address:
0x1000d3c0

◆ Read() [2/2]

void ArkHash::Read ( BinStream & stream)

Replace the strings and the table with the ones a stream stores.

The stream stores the size of the strings, the strings, the number of slots, and one offset into the strings per slot, where zero marks an empty slot.

Parameters
streamThe stream.
Ghidra address:
0x1000d470

Member Data Documentation

◆ mHeap

char* ArkHash::mHeap

The strings.

◆ mHeapEnd

char* ArkHash::mHeapEnd

One past the strings.

◆ mFree

char* ArkHash::mFree

One past the strings in use, the same as mHeapEnd.


The documentation for this class was generated from the following files: