Cluedo Solver v1.0
Cluedo game solver making deductions.
Loading...
Searching...
No Matches
Cluedo::LanguageStrings Class Reference

#include <LanguageStrings.hpp>

Classes

struct  Language
 A struct that contains the data of a language. More...
 

Public Member Functions

std::string_view current_language_id () const
 
void set_language (std::string_view id)
 
std::string_view get_string (std::string_view key) const
 

Static Public Member Functions

static LanguageStringsthe ()
 
static std::vector< Language > const & languages ()
 

Detailed Description

The class that contains the strings of the application which can be translated.

Note
This class is a singleton.

Member Function Documentation

◆ current_language_id()

std::string_view Cluedo::LanguageStrings::current_language_id ( ) const
inline

Returns the ID of the current language.

Returns
The ID of the current language.

◆ get_string()

std::string_view Cluedo::LanguageStrings::get_string ( std::string_view key) const

Returns the string with the given key.

Note
The function will fail if the key is not found.
Parameters
keyThe key of the string.

◆ languages()

static std::vector< Language > const & Cluedo::LanguageStrings::languages ( )
inlinestatic

Returns the vector containing the available languages for the application.

Returns
The vector containing the available languages for the application.

◆ set_language()

void Cluedo::LanguageStrings::set_language ( std::string_view id)

Sets the language of the application to the one with the given ID.

Parameters
idThe ID of the language to use.

◆ the()

LanguageStrings & Cluedo::LanguageStrings::the ( )
static

Returns the instance of the class.

Returns
The instance of the class.

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