Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
LegacyTextFormat.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "RuleTypes.hpp"
4
5#include <cstddef>
6#include <cstdint>
7#include <expected>
8#include <functional>
9#include <string>
10#include <string_view>
11
12namespace monopoly::language
13{
14 inline constexpr std::size_t LegacyFormattedMessageLimit = 2047;
15
17 {
18 std::int64_t numberB{};
19 std::int64_t numberC{};
20 std::int64_t numberD{};
21 std::int64_t numberE{};
22 std::u16string_view stringA{};
23 };
24
26 {
27 std::function<std::expected<std::u16string, std::string>(
29 std::function<std::expected<std::u16string, std::string>(
30 std::int64_t)> squareName;
31 std::function<std::expected<std::u16string, std::string>(
32 std::uint32_t)> propertySetNames;
33 };
34
35 [[nodiscard]] std::expected<std::u16string, std::string>
36 wideToUtf16(std::wstring_view text);
37
38 [[nodiscard]] std::expected<std::u16string, std::string>
40 std::u16string_view pattern,
44}
std::string_view text
unsigned index
constexpr std::size_t LegacyFormattedMessageLimit
std::expected< std::u16string, std::string > wideToUtf16(std::wstring_view text)
std::expected< std::u16string, std::string > formatLegacyMessage(std::u16string_view pattern, const LegacyFormatArguments &arguments, const LegacyFormatResolvers &resolvers, std::size_t limit)
std::uint8_t PlayerNumber
Definition RuleTypes.hpp:12
std::function< std::expected< std::u16string, std::string >(rules::PlayerNumber)> playerName
std::function< std::expected< std::u16string, std::string >(std::uint32_t)> propertySetNames
std::function< std::expected< std::u16string, std::string >(std::int64_t)> squareName