Luanti 5.16.0-dev
Loading...
Searching...
No Matches
GettextPluralForm Class Reference

#include <gettext_plural_form.h>

Public Types

using NumT = unsigned long
using Function = std::function<NumT(NumT)>
using Ptr = std::shared_ptr<GettextPluralForm>

Public Member Functions

 GettextPluralForm (std::wstring_view str)
size_t size () const
NumT operator() (const NumT n) const
 operator bool () const

Static Public Member Functions

static Ptr parseHeaderLine (std::wstring_view str)

Private Attributes

size_t nplurals = 0
Function func = nullptr

Member Typedef Documentation

◆ Function

using GettextPluralForm::Function = std::function<NumT(NumT)>

◆ NumT

using GettextPluralForm::NumT = unsigned long

◆ Ptr

using GettextPluralForm::Ptr = std::shared_ptr<GettextPluralForm>

Constructor & Destructor Documentation

◆ GettextPluralForm()

GettextPluralForm::GettextPluralForm ( std::wstring_view str)

References func, nplurals, parse(), size(), str_ends_with(), and str_starts_with().

Referenced by parseHeaderLine().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ operator bool()

GettextPluralForm::operator bool ( ) const
inline

References nplurals.

◆ operator()()

NumT GettextPluralForm::operator() ( const NumT n) const
inline

References func.

◆ parseHeaderLine()

Ptr GettextPluralForm::parseHeaderLine ( std::wstring_view str)
inlinestatic

References GettextPluralForm().

Referenced by Translations::loadMoTranslation(), and Translations::loadPoTranslation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

size_t GettextPluralForm::size ( ) const
inline

References nplurals.

Referenced by GettextPluralForm(), and Translations::addPluralTranslation().

Here is the caller graph for this function:

Member Data Documentation

◆ func

Function GettextPluralForm::func = nullptr
private

Referenced by GettextPluralForm(), and operator()().

◆ nplurals

size_t GettextPluralForm::nplurals = 0
private

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