HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
v1::detail::translate_args< Values > Class Template Reference

#include <hikogui/i18n/translate.hpp>

Inheritance diagram for v1::detail::translate_args< Values >:
v1::detail::translate_args_base

Public Member Functions

 translate_args (translate_args &&) noexcept=default
 
 translate_args (translate_args const &) noexcept=default
 
translate_argsoperator= (translate_args &&) noexcept=default
 
translate_argsoperator= (translate_args const &) noexcept=default
 
template<typename... Args>
 translate_args (Args const &...args) noexcept
 Construct a translate arguments.
 
std::unique_ptr< translate_args_baseunique_copy () const noexcept
 Make a unique copy of the arguments.
 
virtual bool equal_to (translate_args_base const &rhs) const noexcept
 
std::string format (std::string_view fmt) const noexcept override
 Format text from the arguments and the given format string.
 
std::string format (std::locale const &loc, std::string_view fmt) const noexcept override
 Format text from the arguments and the given format string.
 
template<std::size_t I>
long long n_recurse () const noexcept
 
long long n () const noexcept override
 The numeric value of the first numeric argument.
 
- Public Member Functions inherited from v1::detail::translate_args_base
bool friend operator== (translate_args_base const &lhs, translate_args_base const &rhs) noexcept
 

Detailed Description

template<typename... Values>
class v1::detail::translate_args< Values >

Delayed formatting.

This class will capture all the arguments so that it may be passed to another thread. Then call the function operator to do the actual formatting.

Constructor & Destructor Documentation

◆ translate_args()

template<typename... Values>
template<typename... Args>
v1::detail::translate_args< Values >::translate_args ( Args const &... args)
inlinenoexcept

Construct a translate arguments.

All arguments are passed by forwarding-references so that values can be moved into the storage of the translate object.

Arguments passed by reference will be copied. Arguments passed by std::string_view or std::span will be copied into a std::string or std::vector.

Literal strings will not be copied, instead a pointer is taken.

Parameters
argsThe parameters to std::format excluding format string and locale.

Member Function Documentation

◆ equal_to()

template<typename... Values>
virtual bool v1::detail::translate_args< Values >::equal_to ( translate_args_base const & rhs) const
inlinevirtualnoexcept

◆ format() [1/2]

template<typename... Values>
std::string v1::detail::translate_args< Values >::format ( std::locale const & loc,
std::string_view fmt ) const
inlineoverridevirtualnoexcept

Format text from the arguments and the given format string.

@patam loc The locale to use when formatting.

Parameters
fmtThe format string.

Implements v1::detail::translate_args_base.

◆ format() [2/2]

template<typename... Values>
std::string v1::detail::translate_args< Values >::format ( std::string_view fmt) const
inlineoverridevirtualnoexcept

Format text from the arguments and the given format string.

Parameters
fmtThe format string.

Implements v1::detail::translate_args_base.

◆ n()

template<typename... Values>
long long v1::detail::translate_args< Values >::n ( ) const
inlineoverridevirtualnoexcept

The numeric value of the first numeric argument.

Returns
The numeric value of the first numeric argument or zero.

Implements v1::detail::translate_args_base.

◆ unique_copy()

template<typename... Values>
std::unique_ptr< translate_args_base > v1::detail::translate_args< Values >::unique_copy ( ) const
inlinevirtualnoexcept

Make a unique copy of the arguments.

Implements v1::detail::translate_args_base.


The documentation for this class was generated from the following file: