mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Introduce Options and use them for Menu.
Introduce Options for components. This allows me to add new features, without updating functions signatures.
This commit is contained in:
		 ArthurSonzogni
					ArthurSonzogni
				
			
				
					committed by
					
						 Arthur Sonzogni
						Arthur Sonzogni
					
				
			
			
				
	
			
			
			 Arthur Sonzogni
						Arthur Sonzogni
					
				
			
						parent
						
							82adc3b410
						
					
				
				
					commit
					cd84b187b3
				
			| @@ -19,40 +19,6 @@ int wchar_width_cjk(wchar_t); | ||||
| int wstring_width(const std::wstring&); | ||||
| int wstring_width_cjk(const std::wstring&); | ||||
|  | ||||
| /// @brief For convenience, this class convert multiple mutable string | ||||
| /// references toward a shared representation. | ||||
| class StringRef { | ||||
|  public: | ||||
|   StringRef(std::wstring* ref); | ||||
|   StringRef(std::wstring ref); | ||||
|   StringRef(const wchar_t* ref); | ||||
|   StringRef(const char* ref); | ||||
|  | ||||
|   std::wstring& operator*(); | ||||
|   std::wstring* operator->(); | ||||
|  | ||||
|  private: | ||||
|   std::wstring* const borrowed_ = nullptr; | ||||
|   std::wstring owned_; | ||||
| }; | ||||
|  | ||||
| /// @brief For convenience, this class convert multiple immutable string | ||||
| /// references toward  shared representation. | ||||
| class ConstStringRef { | ||||
|  public: | ||||
|   ConstStringRef(const std::wstring* ref); | ||||
|   ConstStringRef(std::wstring ref); | ||||
|   ConstStringRef(const wchar_t* ref); | ||||
|   ConstStringRef(const char* ref); | ||||
|  | ||||
|   const std::wstring& operator*(); | ||||
|   const std::wstring* operator->(); | ||||
|  | ||||
|  private: | ||||
|   const std::wstring* const borrowed_ = nullptr; | ||||
|   const std::wstring owned_; | ||||
| }; | ||||
|  | ||||
| }  // namespace ftxui | ||||
|  | ||||
| #endif /* end of include guard: FTXUI_SCREEN_STRING_HPP */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user