78 template<
typename... Args>
86 template<
typename... Args>
96 _icon(other._icon), _msgid(other._msgid), _args(other._args->make_unique_copy())
103 _msgid = other._msgid;
104 _args = other._args->make_unique_copy();
109 label &operator=(
label &&other)
noexcept =
default;
111 [[nodiscard]]
bool has_icon()
const noexcept
113 return static_cast<bool>(_icon);
116 [[nodiscard]]
icon icon()
const noexcept
121 [[nodiscard]]
bool has_text()
const noexcept
123 return _msgid.
size() != 0;
126 [[nodiscard]] std::u8string text()
const noexcept
128 auto fmt = get_translation(_msgid);
130 return _args->format(fmt);
133 [[nodiscard]]
friend bool operator==(
label const &lhs,
label const &rhs)
noexcept
135 return lhs._icon == rhs._icon && lhs._msgid == rhs._msgid && lhs._args->eq(*rhs._args);
138 [[nodiscard]]
friend std::u8string to_u8string(
label const &rhs)
noexcept
145 auto tmp = to_u8string(rhs);
146 return std::string{
reinterpret_cast<char const *
>(tmp.data()), tmp.
size()};
151 return lhs << to_string(rhs);
156 std::u8string _msgid;