|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A writable string block resolving values to byte-perfect offsets: the journaled original offset while the value still matches, else an equal existing entry, else a fresh append. More...
#include <wowlib/db/codec_detail.hpp>
Public Member Functions | |
| StringPool (const formats::StringBlock &source) | |
| Copy source (leading with the mandatory zero byte) and index it. | |
| std::uint32_t | resolve (std::string_view value, const std::vector< std::uint32_t > &journal, std::size_t &cursor) |
| The offset to store for value: journal[cursor] when it still holds value, else a deduped/appended offset. | |
Public Attributes | |
| formats::StringBlock | block |
| std::unordered_map< std::string, std::uint32_t > | lookup |
A writable string block resolving values to byte-perfect offsets: the journaled original offset while the value still matches, else an equal existing entry, else a fresh append.
Definition at line 33 of file codec_detail.hpp.
|
explicit |
Copy source (leading with the mandatory zero byte) and index it.
Definition at line 43 of file codec_common.cpp.
| std::uint32_t wowlib::db::detail::StringPool::resolve | ( | std::string_view | value, |
| const std::vector< std::uint32_t > & | journal, | ||
| std::size_t & | cursor ) |
The offset to store for value: journal[cursor] when it still holds value, else a deduped/appended offset.
cursor advances one slot.
Definition at line 49 of file codec_common.cpp.
Referenced by wowlib::db::detail::encodeInlineRecord().
| formats::StringBlock wowlib::db::detail::StringPool::block |
Definition at line 34 of file codec_detail.hpp.
Referenced by resolve(), StringPool(), wowlib::db::writeWdb2(), and wowlib::db::writeWdbc().
| std::unordered_map<std::string, std::uint32_t> wowlib::db::detail::StringPool::lookup |
Definition at line 35 of file codec_detail.hpp.
Referenced by resolve(), and StringPool().