Table of Contents

Class StringBlock

Namespace
WoWLib.Formats
Assembly
WoWLib.dll

A chunk of zero-terminated strings (texture and model filenames, group names), decoded into (offset, value) entries. Other chunks reference entries by their byte offset in the on-disk blob; adding appends, and existing offsets never move.

public class StringBlock : IDisposable
Inheritance
StringBlock
Implements
Inherited Members

Constructors

StringBlock()

public StringBlock()

StringBlock(StringBlock)

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

public StringBlock(StringBlock other)

Parameters

other StringBlock

Properties

Empty

Whether the on-disk blob holds any bytes.

public bool Empty { get; }

Property Value

bool

Size

The on-disk blob size in bytes, trailing padding included.

public ulong Size { get; }

Property Value

ulong

Methods

Add(string)

Append a string; existing offsets never move.

public uint Add(string @string)

Parameters

string string

Returns

uint

the offset the new string starts at - the value to store in referencing chunks

At(uint)

The string at a byte offset another chunk stored; empty if the offset lands on padding or out of range.

public string At(uint offset)

Parameters

offset uint

byte offset into the on-disk blob

Returns

string

the referenced string (a mid-entry offset yields the suffix)

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()

Entries()

The decoded entries, in blob order.

public Vector<StringBlock.Entry> Entries()

Returns

Vector<StringBlock.Entry>

the (offset, value) entries