mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Add coverage and remove deprecated WideInput.
This commit is contained in:
		| @@ -93,9 +93,6 @@ Component Collapsible(ConstStringRef label, | ||||
|                       Ref<bool> show = false); | ||||
| }  // namespace ftxui | ||||
|  | ||||
| // Include component using the old deprecated wstring. | ||||
| #include "ftxui/component/deprecated.hpp" | ||||
|  | ||||
| #endif /* end of include guard: FTXUI_COMPONENT_HPP */ | ||||
|  | ||||
| // Copyright 2021 Arthur Sonzogni. All rights reserved. | ||||
|   | ||||
| @@ -1,18 +0,0 @@ | ||||
| #ifndef FTXUI_COMPONENT_DEPRECATED_HPP | ||||
| #define FTXUI_COMPONENT_DEPRECATED_HPP | ||||
|  | ||||
| #include "ftxui/component/component.hpp" | ||||
|  | ||||
| namespace ftxui { | ||||
|  | ||||
| [[deprecated("use Input with normal std::string instead.")]] Component Input( | ||||
|     WideStringRef content, | ||||
|     ConstStringRef placeholder, | ||||
|     Ref<InputOption> option = {}); | ||||
| }  // namespace ftxui | ||||
|  | ||||
| #endif /* FTXUI_COMPONENT_DEPRECATED_HPP */ | ||||
|  | ||||
| // Copyright 2021 Arthur Sonzogni. All rights reserved. | ||||
| // Use of this source code is governed by the MIT license that can be found in | ||||
| // the LICENSE file. | ||||
| @@ -55,23 +55,6 @@ class StringRef { | ||||
|   std::string* address_ = nullptr; | ||||
| }; | ||||
|  | ||||
| /// @brief An adapter. Own or reference a constant string. For convenience, this | ||||
| /// class convert multiple mutable string toward a shared representation. | ||||
| class WideStringRef { | ||||
|  public: | ||||
|   WideStringRef(std::wstring* ref) : address_(ref) {} | ||||
|   WideStringRef(std::wstring ref) : owned_(std::move(ref)) {} | ||||
|   WideStringRef(const wchar_t* ref) : WideStringRef(std::wstring(ref)) {} | ||||
|   WideStringRef(const char* ref) | ||||
|       : WideStringRef(to_wstring(std::string(ref))) {} | ||||
|   std::wstring& operator*() { return address_ ? *address_ : owned_; } | ||||
|   std::wstring* operator->() { return address_ ? address_ : &owned_; } | ||||
|  | ||||
|  private: | ||||
|   std::wstring owned_; | ||||
|   std::wstring* address_ = nullptr; | ||||
| }; | ||||
|  | ||||
| /// @brief An adapter. Own or reference a constant string. For convenience, this | ||||
| /// class convert multiple immutable string toward a shared representation. | ||||
| class ConstStringRef { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ArthurSonzogni
					ArthurSonzogni