Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
gettext_plural_form.cpp File Reference
#include "gettext_plural_form.h"
#include "util/string.h"
+ Include dependency graph for gettext_plural_form.cpp:

Classes

class  Identity
 
class  ConstValue
 
class  UnaryOperation< F >
 
class  BinaryOperation< F >
 
class  TernaryOperation
 

Typedefs

typedef std::pair< GettextPluralForm::Ptr, std::wstring_view > ParserResult
 
typedef ParserResult(* Parser) (const size_t, const std::wstring_view &)
 

Functions

static size_t minsize (const GettextPluralForm::Ptr &form)
 
static size_t minsize (const GettextPluralForm::Ptr &f, const GettextPluralForm::Ptr &g)
 
static ParserResult parse_expr (const size_t nplurals, const std::wstring_view &str)
 
template<Parser Parser, template< typename > typename Operator>
static ParserResult reduce_ltr (const size_t nplurals, const ParserResult &res, const wchar_t *pattern)
 
template<Parser Parser>
static ParserResult reduce_ltr (const size_t nplurals, const ParserResult &res, const wchar_t **)
 
template<Parser Parser, template< typename > typename Operator, template< typename > typename... Operators>
static ParserResult reduce_ltr (const size_t nplurals, const ParserResult &res, const wchar_t **patterns)
 
template<Parser Parser, template< typename > typename Operator, template< typename > typename... Operators>
static ParserResult parse_ltr (const size_t nplurals, const std::wstring_view &str, const wchar_t **patterns)
 
static ParserResult parse_atomic (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_parenthesized (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_negation (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_multiplicative (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_additive (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_comparison (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_equality (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_conjunction (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_disjunction (const size_t nplurals, const std::wstring_view &str)
 
static ParserResult parse_ternary (const size_t nplurals, const std::wstring_view &str)
 

Typedef Documentation

◆ Parser

typedef ParserResult(* Parser) (const size_t, const std::wstring_view &)

◆ ParserResult

typedef std::pair<GettextPluralForm::Ptr, std::wstring_view> ParserResult

Function Documentation

◆ minsize() [1/2]

static size_t minsize ( const GettextPluralForm::Ptr & f,
const GettextPluralForm::Ptr & g )
static

References minsize().

+ Here is the call graph for this function:

◆ minsize() [2/2]

static size_t minsize ( const GettextPluralForm::Ptr & form)
static

Referenced by ModApiParticles::l_add_particlespawner(), ModApiMainMenu::l_set_background(), minsize(), and GUIEngine::setTexture().

+ Here is the caller graph for this function:

◆ parse_additive()

static ParserResult parse_additive ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

+ Here is the call graph for this function:

◆ parse_atomic()

static ParserResult parse_atomic ( const size_t nplurals,
const std::wstring_view & str )
static

References trim().

Referenced by parse_parenthesized().

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

◆ parse_comparison()

static ParserResult parse_comparison ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

+ Here is the call graph for this function:

◆ parse_conjunction()

static ParserResult parse_conjunction ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

+ Here is the call graph for this function:

◆ parse_disjunction()

static ParserResult parse_disjunction ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

Referenced by parse_ternary().

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

◆ parse_equality()

static ParserResult parse_equality ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

+ Here is the call graph for this function:

◆ parse_expr()

static ParserResult parse_expr ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ternary(), and trim().

Referenced by GettextPluralForm::parse(), and parse_parenthesized().

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

◆ parse_ltr()

template<Parser Parser, template< typename > typename Operator, template< typename > typename... Operators>
static ParserResult parse_ltr ( const size_t nplurals,
const std::wstring_view & str,
const wchar_t ** patterns )
static

References reduce_ltr(), and trim().

Referenced by parse_additive(), parse_comparison(), parse_conjunction(), parse_disjunction(), parse_equality(), and parse_multiplicative().

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

◆ parse_multiplicative()

static ParserResult parse_multiplicative ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_ltr().

+ Here is the call graph for this function:

◆ parse_negation()

static ParserResult parse_negation ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_negation(), parse_parenthesized(), and trim().

Referenced by parse_negation().

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

◆ parse_parenthesized()

static ParserResult parse_parenthesized ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_atomic(), parse_expr(), and trim().

Referenced by parse_negation().

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

◆ parse_ternary()

static ParserResult parse_ternary ( const size_t nplurals,
const std::wstring_view & str )
static

References parse_disjunction(), parse_ternary(), and trim().

Referenced by parse_expr(), and parse_ternary().

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

◆ reduce_ltr() [1/3]

template<Parser Parser>
static ParserResult reduce_ltr ( const size_t nplurals,
const ParserResult & res,
const wchar_t **  )
static

◆ reduce_ltr() [2/3]

template<Parser Parser, template< typename > typename Operator, template< typename > typename... Operators>
static ParserResult reduce_ltr ( const size_t nplurals,
const ParserResult & res,
const wchar_t ** patterns )
static

References reduce_ltr().

+ Here is the call graph for this function:

◆ reduce_ltr() [3/3]

template<Parser Parser, template< typename > typename Operator>
static ParserResult reduce_ltr ( const size_t nplurals,
const ParserResult & res,
const wchar_t * pattern )
static

References str_starts_with(), and trim().

Referenced by parse_ltr(), and reduce_ltr().

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