mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:12:43 +00:00 
			
		
		
		
	AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const
This commit is contained in:
		
							parent
							
								
									15f4043a7a
								
							
						
					
					
						commit
						fdfda6dec2
					
				
					 55 changed files with 354 additions and 455 deletions
				
			
		|  | @ -26,6 +26,7 @@ | |||
| 
 | ||||
| #include <AK/FlyString.h> | ||||
| #include <AK/HashTable.h> | ||||
| #include <AK/Optional.h> | ||||
| #include <AK/String.h> | ||||
| #include <AK/StringUtils.h> | ||||
| #include <AK/StringView.h> | ||||
|  | @ -88,9 +89,9 @@ FlyString::FlyString(const char* string) | |||
| { | ||||
| } | ||||
| 
 | ||||
| int FlyString::to_int(bool& ok) const | ||||
| Optional<int> FlyString::to_int() const | ||||
| { | ||||
|     return StringUtils::convert_to_int(view(), ok); | ||||
|     return StringUtils::convert_to_int(view()); | ||||
| } | ||||
| 
 | ||||
| bool FlyString::equals_ignoring_case(const StringView& other) const | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling