mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-03 23:00:58 +00:00 
			
		
		
		
	Meta: Support generating case-insensitive value-from-string methods
This also extracts the default parameters for generate_value_from_string to a structure. This is just to make it cleaner to add new options.
This commit is contained in:
		
							parent
							
								
									3dccaa39d8
								
							
						
					
					
						commit
						6da1bfeeea
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-17 21:13:51 +09:00 
				
			
			Author: https://github.com/trflynn89
Commit: 6da1bfeeea
Pull-request: https://github.com/SerenityOS/serenity/pull/11799
Reviewed-by: https://github.com/linusg ✅
			
					 2 changed files with 27 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -1077,7 +1077,11 @@ Optional<StringView> get_locale_@enum_snake@_mapping(StringView locale, StringVi
 | 
			
		|||
        for (auto const& alias : aliases)
 | 
			
		||||
            hashes.set(alias.key.hash(), alias.value);
 | 
			
		||||
 | 
			
		||||
        generate_value_from_string(generator, "resolve_{}_alias"sv, s_string_index_type, enum_snake, move(hashes), "StringView"sv, "s_string_list[{}]"sv);
 | 
			
		||||
        ValueFromStringOptions options {};
 | 
			
		||||
        options.return_type = "StringView"sv;
 | 
			
		||||
        options.return_format = "s_string_list[{}]"sv;
 | 
			
		||||
 | 
			
		||||
        generate_value_from_string(generator, "resolve_{}_alias"sv, s_string_index_type, enum_snake, move(hashes), options);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    append_from_string("Locale"sv, "locale"sv, locale_data.locales.keys(), locale_data.locale_aliases);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue