Skip to content

ludus::content::string_dictionary_format

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

Constants and variables

MAGIC

constexpr std::string_view ludus::content::string_dictionary_format::MAGIC {"LUSTR01\0", 8}
Eight-byte file magic, including the trailing NUL.

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

VERSION_1

constexpr uint32 ludus::content::string_dictionary_format::VERSION_1 = 1
Version 1: canonical sorted spellings with a uint32 offset/length directory.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

CURRENT_VERSION

constexpr uint32 ludus::content::string_dictionary_format::CURRENT_VERSION = VERSION_1
Version produced by the current writer.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

BYTE_POLICY_UTF8

constexpr uint32 ludus::content::string_dictionary_format::BYTE_POLICY_UTF8 = 1
Spellings are strict UTF-8 without U+0000.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

BYTE_POLICY_BYTES

constexpr uint32 ludus::content::string_dictionary_format::BYTE_POLICY_BYTES = 2
Spellings are opaque bytes without a zero byte; no text encoding is implied.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

REVISION_DIGEST_BYTES

constexpr usize ludus::content::string_dictionary_format::REVISION_DIGEST_BYTES = 32
Width of the producer-supplied content revision digest (for example SHA-256).

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

EMPTY_ENTRY

constexpr uint32 ludus::content::string_dictionary_format::EMPTY_ENTRY = 0
Directory index of the empty spelling in every dictionary.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

MAX_ENTRIES

constexpr uint32 ludus::content::string_dictionary_format::MAX_ENTRIES = uint32{1} << 24
Most directory entries, including the empty entry.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

MAX_SPELLING_BYTES

constexpr uint32 ludus::content::string_dictionary_format::MAX_SPELLING_BYTES = 65535
Longest spelling in bytes, excluding its terminator.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

MAX_BLOB_BYTES

constexpr uint32 ludus::content::string_dictionary_format::MAX_BLOB_BYTES = uint32{256} * 1024 * 1024
Largest spelling blob in bytes, including every terminator.

Related types: uint32

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

MAGIC_OFFSET

constexpr usize ludus::content::string_dictionary_format::MAGIC_OFFSET = 0
Header field: MAGIC.size() bytes.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

VERSION_OFFSET

constexpr usize ludus::content::string_dictionary_format::VERSION_OFFSET = MAGIC_OFFSET + MAGIC.size()
Header field: uint32 format version.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

BYTE_POLICY_OFFSET

constexpr usize ludus::content::string_dictionary_format::BYTE_POLICY_OFFSET = VERSION_OFFSET + sizeof(uint32)
Header field: uint32 BYTE_POLICY_UTF8 or BYTE_POLICY_BYTES.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

ENTRY_COUNT_OFFSET

constexpr usize ludus::content::string_dictionary_format::ENTRY_COUNT_OFFSET = BYTE_POLICY_OFFSET + sizeof(uint32)
Header field: uint32 directory entry count, 1..MAX_ENTRIES.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

DIRECTORY_BYTES_OFFSET

constexpr usize ludus::content::string_dictionary_format::DIRECTORY_BYTES_OFFSET = ENTRY_COUNT_OFFSET + sizeof(uint32)
Header field: uint32 directory size, exactly EntryCount * DIRECTORY_ENTRY_BYTES.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

BLOB_BYTES_OFFSET

constexpr usize ludus::content::string_dictionary_format::BLOB_BYTES_OFFSET = DIRECTORY_BYTES_OFFSET + sizeof(uint32)
Header field: uint32 spelling blob size, at most MAX_BLOB_BYTES.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

RESERVED_OFFSET

constexpr usize ludus::content::string_dictionary_format::RESERVED_OFFSET = BLOB_BYTES_OFFSET + sizeof(uint32)
Header field: uint32 reserved word; must be zero.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

REVISION_DIGEST_OFFSET

constexpr usize ludus::content::string_dictionary_format::REVISION_DIGEST_OFFSET = RESERVED_OFFSET + sizeof(uint32)
Header field: REVISION_DIGEST_BYTES identifying the content revision.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

HEADER_BYTES

constexpr usize ludus::content::string_dictionary_format::HEADER_BYTES = REVISION_DIGEST_OFFSET + REVISION_DIGEST_BYTES
Header size; the directory starts here.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

ENTRY_OFFSET_FIELD

constexpr usize ludus::content::string_dictionary_format::ENTRY_OFFSET_FIELD = 0
Directory entry field: uint32 spelling offset from the start of the blob.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

ENTRY_LENGTH_FIELD

constexpr usize ludus::content::string_dictionary_format::ENTRY_LENGTH_FIELD = ENTRY_OFFSET_FIELD + sizeof(uint32)
Directory entry field: uint32 spelling length in bytes, excluding the terminator.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

DIRECTORY_ENTRY_BYTES

constexpr usize ludus::content::string_dictionary_format::DIRECTORY_ENTRY_BYTES = ENTRY_LENGTH_FIELD + sizeof(uint32)
Size of one directory entry.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

MAX_DICTIONARY_BYTES

constexpr usize ludus::content::string_dictionary_format::MAX_DICTIONARY_BYTES =
HEADER_BYTES + usize{MAX_ENTRIES} * DIRECTORY_ENTRY_BYTES + usize{MAX_BLOB_BYTES}
Largest admitted dictionary in bytes.

Related types: usize

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

Aliases

uint32

using ludus::foundation::core::uint32 = std::uint32_t
Exact 32-bit unsigned integer for explicit-width values.

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

uint8

using ludus::foundation::core::uint8 = std::uint8_t
Exact 8-bit unsigned integer for explicit-width values.

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h

usize

using ludus::foundation::core::usize = std::size_t
Native unsigned size/index type; matches sizeof and container sizes, not a wire format.

Declared in modules/content/string_dictionary_format/include/ludus/content/string_dictionary_format/lustr.h