nw::Resref

struct Resref

nw::Resref names a resource.

In NWN1/EE they are 16 character arrays, in NWN2 32 character arrays. These character arrays are case-insenstive.

Later evolutions of resrefs, in Dragon Age, were 32 utf16 character arrays; then ultimately seem to have been replaced by a combination of FNV hashes.

Currently only the NWN1/EE variety is supported.

Public Types

using Storage = std::array<char, max_size>
using value_type = typename Storage::value_type
using size_type = typename Storage::size_type

Public Functions

Resref()
Resref(const Resref&) = default
template<size_t N>
Resref(std::array<char, N> &string) noexcept
Resref(const char *string) noexcept
Resref(StringView string) noexcept
Resref &operator=(const Resref&) = default
const Storage &data() const noexcept

Get underlying storage.

bool empty() const noexcept

Checks if the underlying array has no non-null characters.

size_type length() const noexcept

Returns the number of char elements in the array, excluding nulls.

String string() const

Creates String of underlying array.

StringView view() const noexcept

Creates StringView of underlying array without null padding.

Public Static Attributes

static constexpr size_t max_size = 32