39 LL_WALKER fieldWalker{ aFieldsPtr, aEndKey, aDb };
43 if( block->GetBlockType() != 0x03 )
48 if( field.m_Hdr1 != aFieldCode )
51 switch( field.m_SubType )
55 const std::string* str = std::get_if<std::string>( &field.m_Substruct );
58 return wxString( *str );
64 const uint32_t* val = std::get_if<uint32_t>( &field.m_Substruct );
86 if( uint32_t* val = std::get_if<uint32_t>( &
result.value() ) )
87 return static_cast<int>( *val );
std::optional< FIELD_VALUE > GetFirstFieldOfType(const BRD_DB &aDb, uint32_t aFieldsPtr, uint32_t aEndKey, uint16_t aFieldCode)
Look up the first 0x03 FIELD value of a given type in a linked field chain.
std::optional< int > GetFirstFieldOfTypeInt(const BRD_DB &aDb, uint32_t aFieldsPtr, uint32_t aEndKey, uint16_t aFieldCode)
Convenience wrapper around GetFirstFieldOfType() for integer-valued fields.
wxString result
Test unit parsing edge cases and error handling.