Smolgui
Immediate gui library based on SFML
Loading...
Searching...
No Matches
sgui::TextContainer Class Reference

store text accessible with a string key, with option to load and store text for a given tongue, so it has simple support for localisation. More...

#include <TextContainer.h>

Public Member Functions

const std::string & tongue () const
 get current tongue used
void setTongue (const std::string &tongue)
 set tongue used
bool reload (const std::string &tongue="")
 reload all texts for the active tongue
bool loadFromFile (const std::string &filename, const std::string &tongue="")
 load texts from a filename for this given tongue. By default it uses active tongue.
void saveInFile (const std::string &filename)
 save texts of the current tongue
void add (const std::string &key, const std::string &text)
 add a text with a given key to the container for the current tongue
void remove (const std::string &key)
 remove text from the container for the current tongue
std::string & get (const std::string &entry)
 get mutable text entry for the current tongue
const std::string & get (const std::string &entry) const
 get text entry for the current tongue
bool has (const std::string &entry) const
 check that entry is stored

Detailed Description

store text accessible with a string key, with option to load and store text for a given tongue, so it has simple support for localisation.

Member Function Documentation

◆ add()

void sgui::TextContainer::add ( const std::string & key,
const std::string & text )

add a text with a given key to the container for the current tongue

◆ get() [1/2]

std::string & sgui::TextContainer::get ( const std::string & entry)

get mutable text entry for the current tongue

◆ get() [2/2]

const std::string & sgui::TextContainer::get ( const std::string & entry) const

get text entry for the current tongue

◆ has()

bool sgui::TextContainer::has ( const std::string & entry) const

check that entry is stored

◆ loadFromFile()

bool sgui::TextContainer::loadFromFile ( const std::string & filename,
const std::string & tongue = "" )

load texts from a filename for this given tongue. By default it uses active tongue.

◆ reload()

bool sgui::TextContainer::reload ( const std::string & tongue = "")

reload all texts for the active tongue

◆ remove()

void sgui::TextContainer::remove ( const std::string & key)

remove text from the container for the current tongue

◆ saveInFile()

void sgui::TextContainer::saveInFile ( const std::string & filename)

save texts of the current tongue

◆ setTongue()

void sgui::TextContainer::setTongue ( const std::string & tongue)

set tongue used

◆ tongue()

const std::string & sgui::TextContainer::tongue ( ) const

get current tongue used


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