ludus::content::string_dictionary_format¶
Ludus Wiki · API overview · Browse API
Namespace
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.
VERSION_1¶
constexpr uint32 ludus::content::string_dictionary_format::VERSION_1 = 1
Related types: uint32
CURRENT_VERSION¶
constexpr uint32 ludus::content::string_dictionary_format::CURRENT_VERSION = VERSION_1
Version produced by the current writer.
Related types: uint32
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
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
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
EMPTY_ENTRY¶
constexpr uint32 ludus::content::string_dictionary_format::EMPTY_ENTRY = 0
Directory index of the empty spelling in every dictionary.
Related types: uint32
MAX_ENTRIES¶
constexpr uint32 ludus::content::string_dictionary_format::MAX_ENTRIES = uint32{1} << 24
Most directory entries, including the empty entry.
Related types: uint32
MAX_SPELLING_BYTES¶
constexpr uint32 ludus::content::string_dictionary_format::MAX_SPELLING_BYTES = 65535
Longest spelling in bytes, excluding its terminator.
Related types: uint32
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
MAGIC_OFFSET¶
constexpr usize ludus::content::string_dictionary_format::MAGIC_OFFSET = 0
Header field: MAGIC.size() bytes.
Related types: usize
VERSION_OFFSET¶
constexpr usize ludus::content::string_dictionary_format::VERSION_OFFSET = MAGIC_OFFSET + MAGIC.size()
Header field: uint32 format version.
Related types: usize
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
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
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
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
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
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
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
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
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
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
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
Aliases¶
uint32¶
using ludus::foundation::core::uint32 = std::uint32_t
Exact 32-bit unsigned integer for explicit-width values.
uint8¶
using ludus::foundation::core::uint8 = std::uint8_t
Exact 8-bit unsigned integer for explicit-width values.
usize¶
using ludus::foundation::core::usize = std::size_t
Native unsigned size/index type; matches sizeof and container sizes, not a wire format.