Table of Contents

Class TableBase

Namespace
WoWLib.Database
Assembly
WoWLib.dll

The common surface of every client-database table: decode (read), encode (write), validation, and the preserved decode state. Concrete tables add their typed records.

public class TableBase : IDisposable
Inheritance
TableBase
Implements
Derived
Inherited Members

Constructors

TableBase()

public TableBase()

TableBase(TableBase)

Copy-construct: a deep copy of other (the C++ copy constructor).

public TableBase(TableBase other)

Parameters

other TableBase

Properties

EncryptedSections

The encrypted sections skipped on read: their records are not in records, but the file re-writes them verbatim.

public Vector<EncryptedSection> EncryptedSections { get; }

Property Value

Vector<EncryptedSection>

FullyDecoded

Whether the whole table decoded — false when encrypted sections were skipped.

public bool FullyDecoded { get; }

Property Value

bool

Strings

The preserved string block the record string fields were decoded from; offsets never move, write() appends new strings past its end.

public StringBlock Strings { get; }

Property Value

StringBlock

Methods

Dispose()

Release the native object now. Optional: the finalizer releases it on collection anyway - dispose (or using) when you want native memory back promptly.

public virtual void Dispose()

EnsureValid()

Validate and raise on the first error instead of returning a report — the assert-style face of validate().

public void EnsureValid()

Read(byte[])

Decode a table file image.

public void Read(byte[] data)

Parameters

data byte[]

the whole file content

Read(FileSystem, FileKey)

Load the table from a client filesystem.

public void Read(FileSystem fs, FileKey key)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the file to read

Validate()

Check the logical integrity contracts the records must satisfy to survive a write and load in the client: the primary key stays unique, and no string holds an embedded NUL the string block would truncate. write() never runs this.

public ValidationReport Validate()

Returns

ValidationReport

every violated contract, in record order

Write(EncryptedPolicy)

Serialize the table to a file image; a loaded table re-emits the format it was read from. policy decides how keyless encrypted sections are handled.

public byte[] Write(EncryptedPolicy policy)

Parameters

policy EncryptedPolicy

keyless-section handling (WDC only)

Returns

byte[]

the file bytes

Write(FileSystem, FileKey, EncryptedPolicy)

Serialize the table into a client filesystem (project overlay); the target path's extension picks .dbc/.db2 in the mixed eras.

public void Write(FileSystem fs, FileKey key, EncryptedPolicy policy)

Parameters

fs FileSystem

the filesystem gateway

key FileKey

the file to write

policy EncryptedPolicy

keyless-section handling (WDC only)