66 if (str ==
"manual") {
69 if (str ==
"automatic") {
74 std::string lower_str = str;
75 std::ranges::transform(
76 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
79 if (lower_str ==
"off") {
82 if (lower_str ==
"none") {
85 if (lower_str ==
"disabled") {
89 if (lower_str ==
"manual") {
93 if (lower_str ==
"automatic") {
96 if (lower_str ==
"auto") {
123 panic(
"unhandled PrimaryPairingMode value");
142 constexpr auto parse(std::format_parse_context &ctx)
PrimaryPairingMode
Controls how a secondary tileset finds its partner primary for compilation.
@ automatic
Scan layout metadata to find the partner primary automatically.
@ off
Skip primary loading entirely. Compile as a standalone secondary.
@ manual
Use the partner primary specified via primary_pairing_partners config.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::optional< PrimaryPairingMode > primary_pairing_mode_from_str(const std::string &str)
Parses a string into a PrimaryPairingMode with fuzzy matching.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.