![]() |
ToyGine2 26.2.0
Game Engine for retro consoles
|
Enumerations | |
| enum class | PlaceholderMode { none , autoIndex , positional } |
Auto vs positional placeholder mode while scanning; used only inside validateFormatImpl(). More... | |
Functions | |
| constexpr bool | consumeEscapedBrace (const CStringView &string, size_t length, size_t &position, char brace) noexcept |
Consumes a literal {{ or }} pair at position when present. | |
| constexpr FormatPatternValidationError | parsePositionalIndex (const CStringView &string, size_t length, size_t &position, size_t argCount) noexcept |
Reads the decimal index and closing } for a positional placeholder. | |
| constexpr FormatPatternValidationError | parseOpeningBrace (const CStringView &string, size_t length, size_t &position, size_t &autoCount, PlaceholderMode &mode, size_t argCount) noexcept |
Parses a non-escaped opening brace: auto {}, positional {N}, or a structural error. | |
| constexpr FormatPatternValidationError | reconcilePlaceholderMode (PlaceholderMode mode, size_t autoCount, size_t argCount) noexcept |
| Verifies placeholder counts against argCount after the whole pattern has been scanned. | |
| constexpr FormatPatternValidationError | validateFormatImpl (const CStringView &string, size_t argCount) noexcept |
Validates auto-indexed {} and positional {N} placeholders for argCount arguments. | |
|
strong |
Auto vs positional placeholder mode while scanning; used only inside validateFormatImpl().
| Enumerator | |
|---|---|
| none | No |
| autoIndex | Only auto |
| positional | Only positional |
|
nodiscardconstexprnoexcept |
Consumes a literal {{ or }} pair at position when present.
| string | Pattern being scanned. |
| length | Byte length of string (same value as string.size()). |
| position | Current index. |
| brace | '{' to match {{, or '}' to match }}. |
true if a pair was consumed; false if position does not start a doubled brace.validateFormatImpl; not part of the public API.
|
nodiscardconstexprnoexcept |
Parses a non-escaped opening brace: auto {}, positional {N}, or a structural error.
| string | Pattern being scanned. |
| length | Byte length of string. |
| position | Index of {; updated past the placeholder on success. |
| autoCount | Incremented for each auto {} placeholder. |
| mode | Updated when the pattern uses auto or positional placeholders. |
| argCount | Upper bound for valid positional indices (N must be less than argCount). |
FormatPatternValidationError encountered, or FormatPatternValidationError::none when the placeholder is well-formed.{ and not the start of {{.validateFormatImpl; not part of the public API.
|
nodiscardconstexprnoexcept |
Reads the decimal index and closing } for a positional placeholder.
| string | Pattern being scanned. |
| length | Byte length of string. |
| position | Index of the first digit inside {…}; updated past the closing } on success. |
| argCount | Upper bound for valid indices (N must be less than argCount). |
FormatPatternValidationError::none on success; FormatPatternValidationError::invalidContent when digits or closing } are missing; FormatPatternValidationError::indexOutOfRange when digit overflow occurs or the index is not less than argCount.parseOpeningBrace; not part of the public API.
|
nodiscardconstexprnoexcept |
Verifies placeholder counts against argCount after the whole pattern has been scanned.
| mode | Whether the pattern used no placeholders, auto {}, or positional {N}. |
| autoCount | Number of {} placeholders when in auto mode. |
| argCount | Expected sizeof...(Args). |
validateFormatImpl; not part of the public API.