Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
LegacyManifest.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstdint>
6#include <expected>
7#include <filesystem>
8#include <istream>
9#include <span>
10#include <string>
11#include <string_view>
12#include <vector>
13
14namespace monopoly::data
15{
32
33
35 {
37 std::filesystem::path path;
38 std::size_t line{};
39 std::string detail;
40 };
41
42
49
50
52 {
53 std::string bankName;
54 std::uint32_t declaredItemCount{};
55 std::vector<LegacyManifestEntry> entries;
56 };
57
58
59 [[nodiscard]] std::string_view manifestErrorCodeName(
60 ManifestErrorCode code) noexcept;
61
62 // Parse uniquement le manifeste de symboles produit par DMAKE99. Il ne
63 // reconstruit ni payload, ni offset, ni taille, ni CRC d'une banque DAT.
64 [[nodiscard]] std::expected<LegacyBankManifest, ManifestError>
66 std::istream& input,
67 std::string bankName,
68 std::filesystem::path diagnosticPath = {});
69
70 [[nodiscard]] std::expected<LegacyBankManifest, ManifestError>
71 readDmakeManifest(const std::filesystem::path& path);
72
73 // Format stable et volontairement simple pour les outils build-time :
74 // bank<TAB>tag_decimal<TAB>type<TAB>symbol.
75 [[nodiscard]] std::expected<void, ManifestError>
77 const std::filesystem::path& outputPath,
78 std::span<const LegacyBankManifest> manifests);
79}
unsigned index
std::string path
Bytes input
std::uint16_t DataTag
Definition DataBanks.hpp:11
std::expected< LegacyBankManifest, ManifestError > readDmakeManifest(const std::filesystem::path &path)
std::expected< void, ManifestError > writeManifestTsv(const std::filesystem::path &outputPath, std::span< const LegacyBankManifest > manifests)
std::string_view manifestErrorCodeName(ManifestErrorCode code) noexcept
std::expected< LegacyBankManifest, ManifestError > parseDmakeManifest(std::istream &input, std::string bankName, std::filesystem::path diagnosticPath)
std::vector< LegacyManifestEntry > entries