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

#include <ttauri/l10n.hpp>

Inheritance diagram for tt::detail::l10n_args< Values >:
tt::detail::l10n_args_base

Public Member Functions

 l10n_args (l10n_args &&) noexcept=default
 
 l10n_args (l10n_args const &) noexcept=default
 
l10n_argsoperator= (l10n_args &&) noexcept=default
 
l10n_argsoperator= (l10n_args const &) noexcept=default
 
template<typename... Args>
 l10n_args (Args const &...args) noexcept
 Construct a l10n arguments.
 
std::unique_ptr< l10n_args_baseunique_copy () const noexcept
 Make a unique copy of the arguments.
 
virtual bool equal_to (l10n_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<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 tt::detail::l10n_args_base
bool friend operator== (l10n_args_base const &lhs, l10n_args_base const &rhs) noexcept
 

Detailed Description

template<typename... Values>
class tt::detail::l10n_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

◆ l10n_args()

template<typename... Values>
template<typename... Args>
tt::detail::l10n_args< Values >::l10n_args ( Args const &... args)
inlinenoexcept

Construct a l10n arguments.

All arguments are passed by forwarding-references so that values can be moved into the storage of the l10n 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 tt::detail::l10n_args< Values >::equal_to ( l10n_args_base const & rhs) const
inlinevirtualnoexcept

◆ format() [1/2]

template<typename... Values>
std::string tt::detail::l10n_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 tt::detail::l10n_args_base.

◆ format() [2/2]

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

Format text from the arguments and the given format string.

Parameters
fmtThe format string.

Implements tt::detail::l10n_args_base.

◆ n()

template<typename... Values>
long long tt::detail::l10n_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 tt::detail::l10n_args_base.

◆ unique_copy()

template<typename... Values>
std::unique_ptr< l10n_args_base > tt::detail::l10n_args< Values >::unique_copy ( ) const
inlinevirtualnoexcept

Make a unique copy of the arguments.

Implements tt::detail::l10n_args_base.


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