mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Add IdString::ends_with()
This commit is contained in:
		
							parent
							
								
									66b5f5166b
								
							
						
					
					
						commit
						3ea0161ae7
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -222,6 +222,12 @@ namespace RTLIL | ||||||
| 				return std::string(c_str() + pos, len); | 				return std::string(c_str() + pos, len); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		bool ends_with(const char* suffix) const { | ||||||
|  | 			size_t len = strlen(suffix); | ||||||
|  | 			if (size() < len) return false; | ||||||
|  | 			return substr(size()-len) == suffix; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		size_t size() const { | 		size_t size() const { | ||||||
| 			return str().size(); | 			return str().size(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue