Porytiles
Loading...
Searching...
No Matches
porytiles::ProviderDefinition Struct Reference

Describes where and how a field's named values are declared. More...

#include <metatile_attribute_schema.hpp>

Collaboration diagram for porytiles::ProviderDefinition:
[legend]

Public Member Functions

bool operator== (const ProviderDefinition &) const =default
 
EnumDefinition to_enum_definition (std::string field_display_name, std::uint32_t max_value) const
 Builds the resolvable enum definition a header provider needs from this description.
 

Public Attributes

std::filesystem::path header
 
std::string prefix
 
std::unordered_set< std::string > skipped {}
 
HeaderFormat format {HeaderFormat::either}
 

Detailed Description

Describes where and how a field's named values are declared.

A provider definition points a field at the header that declares its value names, the prefix those names share, the names to skip during scanning, and which declaration styles are acceptable. It carries no behavior of its own; it is a plain description consumed by later stages that actually read the header.

Definition at line 162 of file metatile_attribute_schema.hpp.

Member Function Documentation

◆ operator==()

bool porytiles::ProviderDefinition::operator== ( const ProviderDefinition ) const
default

◆ to_enum_definition()

EnumDefinition porytiles::ProviderDefinition::to_enum_definition ( std::string  field_display_name,
std::uint32_t  max_value 
) const

Builds the resolvable enum definition a header provider needs from this description.

A ProviderDefinition describes a field's value names in the abstract; a provider that reads a header also needs the field's value cap and a human-readable field name for diagnostics. Those two facts live on the owning Field, not here, so the caller supplies them. The header path is intentionally not carried over: it is resolved separately against the project root before a provider is built.

Parameters
field_display_nameThe field name used in this provider's diagnostics
max_valueThe largest value a resolved name may hold, from the field's width
Returns
An EnumDefinition copying this definition's prefix, skip set, and format alongside the two given facts

Definition at line 40 of file metatile_attribute_schema.cpp.

Member Data Documentation

◆ format

HeaderFormat porytiles::ProviderDefinition::format {HeaderFormat::either}

Definition at line 166 of file metatile_attribute_schema.hpp.

◆ header

std::filesystem::path porytiles::ProviderDefinition::header

Definition at line 163 of file metatile_attribute_schema.hpp.

◆ prefix

std::string porytiles::ProviderDefinition::prefix

Definition at line 164 of file metatile_attribute_schema.hpp.

◆ skipped

std::unordered_set<std::string> porytiles::ProviderDefinition::skipped {}

Definition at line 165 of file metatile_attribute_schema.hpp.


The documentation for this struct was generated from the following files: