vendor_build.h 1.3 KB

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <cstdint>
  3. #include <span>
  4. #include "../../../middleware/content/packages/reader/reader.h"
  5. namespace sunrise::client::content::vendors {
  6. /**
  7. * Extracts the vendor catalog from the installed packages, once.
  8. *
  9. * The whole index is read. A definition is read only for a vendor asked for by hash, as each is
  10. * over 100 KiB and the banks hold nowhere near all 511. The named hashes are checked against the
  11. * index the pass has just read - one it does not carry is a mistyped rule and is logged - and
  12. * whatever room is left is filled from the head of the index, so a short list still gets the
  13. * vendors the old leading window would have covered.
  14. *
  15. * @param source Package directory and borrowed block keys.
  16. * @param scratch Lock-owned block storage shared with the other content passes.
  17. * @param namedHashes Vendor definition hashes named by `vendor_catalog.txt`, in priority order.
  18. * @return True when State already holds the catalog or a full pass publishes it.
  19. */
  20. [[nodiscard]] bool build(const middleware::content::packages::reader::Source& source,
  21. middleware::content::packages::reader::Scratch& scratch,
  22. std::span<const std::uint32_t> namedHashes) noexcept;
  23. } // namespace sunrise::client::content::vendors